Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mymusiclist
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Brian Guadalupe
mymusiclist
Commits
39588f24
Commit
39588f24
authored
Nov 15, 2017
by
Brian Guadalupe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enforce unique email constraint, remove redundant `UserAccount` entity
parent
daedae1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
models.py
user/models.py
+9
-5
No files found.
user/models.py
View file @
39588f24
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)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment