Exemple #1
0
 def add_displayname(self, create, extracted, **kwargs):
     if extracted is None or extracted:
         if "enu" not in self.displaynames:
             displayname = self.package.name.replace("_", " ").title()
             self.displaynames["enu"] = DisplayNameFactory.simple_generate(
                 create, language=Language.find("enu"), displayname=displayname
             )
Exemple #2
0
class DescriptionFactory(SQLAlchemyModelFactory):
    class Meta:
        sqlalchemy_session = db.session
        model = Description

    language = factory.LazyAttribute(lambda x: Language.find("enu"))
    description = factory.LazyAttribute(lambda x: " ".join(fake.sentences(nb=5)))
Exemple #3
0
class DisplayNameFactory(SQLAlchemyModelFactory):
    class Meta:
        sqlalchemy_session = db.session
        model = DisplayName

    language = factory.LazyAttribute(lambda x: Language.find("enu"))
    displayname = factory.LazyAttribute(lambda x: " ".join(fake.words(nb=2)).title())
Exemple #4
0
 def add_displayname(self, create, extracted, **kwargs):
     if extracted is None or extracted:
         if 'enu' not in self.displaynames:
             displayname = self.package.name.replace('_', ' ').title()
             self.displaynames['enu'] = DisplayNameFactory.simple_generate(
                 create,
                 language=Language.find('enu'),
                 displayname=displayname)
Exemple #5
0
 def add_description(self, create, extracted, **kwargs):
     if extracted is None or extracted:
         if 'enu' not in self.descriptions:
             self.descriptions['enu'] = DescriptionFactory.simple_generate(create, language=Language.find('enu'))
Exemple #6
0
 def add_displayname(self, create, extracted, **kwargs):
     if extracted is None or extracted:
         if 'enu' not in self.displaynames:
             displayname = self.package.name.replace('_', ' ').title()
             self.displaynames['enu'] = DisplayNameFactory.simple_generate(create, language=Language.find('enu'),
                                                                           displayname=displayname)
Exemple #7
0
 def add_description(self, create, extracted, **kwargs):
     if extracted is None or extracted:
         if 'enu' not in self.descriptions:
             self.descriptions['enu'] = DescriptionFactory.simple_generate(
                 create, language=Language.find('enu'))