SmartPicasso/rest-app/smartpicasso/app/user_profile/models.py

25 lines
700 B
Python
Raw Normal View History

"""
@author p.dolata
"""
import uuid
from django.db import models
from smartpicasso.app.user.models import User
class UserProfile(models.Model):
"""
Model representing user's profile
"""
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='profile')
first_name = models.CharField(max_length=50, unique=False)
last_name = models.CharField(max_length=50, unique=False)
phone_number = models.CharField(max_length=10, unique=False, null=True, blank=True)
class Meta:
"""
Meta to se table name in database
"""
db_table = 'user_profile'