class UserModel(models.Model):
id = fields.UUIDField(pk=True)
email = fields.CharField(null=False, max_length=255)
hashed_password = fields.CharField(null=True, max_length=255)
is_active = fields.BooleanField(default=False)
confirmation = fields.UUIDField(null=True)
When running this I'm getting an eror:
ValueError: cannot specify both default and default_factory
The issue is probably caused by
id = fields.UUIDField(pk=True)
and
User_Pydantic = pydantic_model_creator( UserModel, name="User", exclude=("hashed_password", "confirmation") )
changing it to
id = fields.IntField(pk=True)
resolves the issue.