mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-01-25 00:34:18 +03:00
Use a more global 'name' field in User model
This commit is contained in:
parent
696d1c5606
commit
6dbe252c83
|
@ -12,5 +12,5 @@ class UserForm(forms.ModelForm):
|
||||||
# Set this form to use the User model.
|
# Set this form to use the User model.
|
||||||
model = User
|
model = User
|
||||||
|
|
||||||
# Constrain the UserForm to just these fields.
|
# Constrain the UserForm to just the name field.
|
||||||
fields = ("first_name", "last_name")
|
fields = ("name", )
|
||||||
|
|
|
@ -2,11 +2,15 @@
|
||||||
from __future__ import unicode_literals, absolute_import
|
from __future__ import unicode_literals, absolute_import
|
||||||
|
|
||||||
from django.contrib.auth.models import AbstractUser
|
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 _
|
# from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
|
|
||||||
class User(AbstractUser):
|
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):
|
def __unicode__(self):
|
||||||
return self.username
|
return self.username
|
||||||
|
|
Loading…
Reference in New Issue
Block a user