Files
tripwithbonus/backend/api/models.py
2025-05-19 13:44:33 +03:00

22 lines
1.4 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from django.contrib.auth.models import User
from django.db import models
from routes.constants.account_types import account_types
import uuid
class UserProfile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
account_type = models.CharField(choices=account_types, default='lite', verbose_name="Тип аккаунта")
is_active = models.BooleanField(default=True)
phone_number = models.CharField(max_length=13, verbose_name="Номер телефона")
birthday = models.DateField(null=True, blank=True, verbose_name="Дата рождения")
privacy_accepted = models.BooleanField(default=False, verbose_name="Согласие с политикой конфиденциальности")
uuid = models.UUIDField(default=uuid.uuid4, editable=False, null=True)
image = models.ImageField(null=True, blank=True)
country = models.CharField(max_length=15,null=True, blank=True, verbose_name="Страна")
city = models.CharField(max_length=35, null=True, blank=True, verbose_name="Город")
newsletter = models.BooleanField(default=False, verbose_name="Подписка на новостную рассылку")
authMailCode = models.CharField(max_length=50)
additionalDetails = models.TextField(null=True, blank=True, verbose_name="Дополнительные детали")
def __str__(self):
return str(self.phone_number)