2020-11-30 22:42:24 +01:00
|
|
|
"""
|
|
|
|
@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')
|
2020-12-09 19:21:30 +01:00
|
|
|
username = models.CharField(max_length=50, unique=True)
|
2020-11-30 22:42:24 +01:00
|
|
|
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'
|