learn-sql-model/templates/model/learn_sql_model/factories/{{modelname.lower()}}.py.jinja
2023-06-08 09:02:43 -05:00

14 lines
383 B
Django/Jinja

from faker import Faker
from polyfactory.factories.pydantic_factory import ModelFactory
from learn_sql_model.models.{{modelname.lower()}} import {{modelname}}
class {{modelname}}Factory(ModelFactory[{{modelname.lower()}}]):
__model__ = {{modelname}}
__faker__ = Faker(locale="en_US")
__set_as_default_factory_for_type__ = True
id = None
__random_seed__ = 10