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 )
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)))
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())
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)
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'))
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)
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'))