Use a more global 'name' field in User model

This commit is contained in:
Daniel Greenfeld 2015-07-15 11:06:03 -07:00
parent 696d1c5606
commit 6dbe252c83
2 changed files with 7 additions and 3 deletions

View File

@ -12,5 +12,5 @@ class UserForm(forms.ModelForm):
# Set this form to use the User model.
model = User
# Constrain the UserForm to just these fields.
fields = ("first_name", "last_name")
# Constrain the UserForm to just the name field.
fields = ("name", )

View File

@ -2,11 +2,15 @@
from __future__ import unicode_literals, absolute_import
from django.contrib.auth.models import AbstractUser
# from django.db import models
from django.db import models
# from django.utils.translation import ugettext_lazy as _
class User(AbstractUser):
# First Name and Last Name do not cover name patterns
# around the globe.
name = models.CharField("Name", blank=True, max_length=255)
def __unicode__(self):
return self.username