mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-01-24 16:24:14 +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.
|
||||
model = User
|
||||
|
||||
# Constrain the UserForm to just these fields.
|
||||
fields = ("first_name", "last_name")
|
||||
# Constrain the UserForm to just the name field.
|
||||
fields = ("name", )
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user