Commit 39588f24 authored by Brian Guadalupe's avatar Brian Guadalupe

Enforce unique email constraint, remove redundant `UserAccount` entity

parent daedae1c
from django.db import models
from django.contrib.auth.models import User
class UserAccount(models.Model):
id = models.AutoField(primary_key=True)
first_name = models.CharField(max_length=64)
last_name = models.CharField(max_length=64)
email = models.CharField(max_length=64)
# Enforce referential integrity at db level
User._meta.get_field('email')._unique = True
# class UserAccount(models.Model):
# id = models.AutoField(primary_key=True)
# first_name = models.CharField(max_length=64)
# last_name = models.CharField(max_length=64)
# email = models.CharField(max_length=64)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment