Files
tripwithbonus/backend/api/models.py
2025-05-18 12:23:05 +03:00

20 lines
1.2 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
import uuid
class UserProfile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
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 {self.phone_number}