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

25 lines
672 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')
username = models.CharField(max_length=50, unique=True)
first_name = models.CharField(max_length=50, unique=False)
last_name = models.CharField(max_length=50, unique=False)
class Meta:
"""
Meta to se table name in database
"""
db_table = 'user_profile'