generateur_v3/backend/api/dbo/auth/models.py
2022-09-16 21:50:55 +02:00

23 lines
609 B
Python

import uuid
from tortoise.models import Model
from tortoise import fields
class User(Model):
id = fields.IntField(pk=True)
clientId = fields.UUIDField(unique=True, default=uuid.uuid4)
username = fields.CharField(max_length=100, unique=True)
hashed_password = fields.CharField(max_length=255)
email = fields.CharField(null=True, max_length=255)
name = fields.CharField(null=True, max_length=255)
firstname = fields.CharField(null=True, max_length=255)
disabled = fields.BooleanField(default=False)
class PydanticMeta:
exclude = ['hashed_password']
class Meta:
table = "users"