learn-sql-model/templates/model/learn_sql_model/factories/{{modelname.lower()}}.py.jinja
2023-06-22 16:27:52 -05:00

12 lines
432 B
Django/Jinja

from faker import Faker
from polyfactory.factories.pydantic_factory import ModelFactory
from learn_sql_model.factories.pet import PetFactory
from learn_sql_model.models.{{ modelname }} import {{ modelname }}
from learn_sql_model.models.pet import Pet
class {{ modelname }}Factory(ModelFactory[{{ modelname }}]):
__model__ = {{ modelname }}
__faker__ = Faker(locale="en_US")
__set_as_default_factory_for_type__ = True