mirror of https://github.com/django/django.git
Splitted User to AbstractUser and User
This commit is contained in:
parent
d9f5e5addb
commit
08bcb4aec1
|
@ -277,7 +277,7 @@ class AbstractBaseUser(models.Model):
|
||||||
|
|
||||||
|
|
||||||
@python_2_unicode_compatible
|
@python_2_unicode_compatible
|
||||||
class User(AbstractBaseUser):
|
class AbstractUser(AbstractBaseUser):
|
||||||
"""
|
"""
|
||||||
Users within the Django authentication system are represented by this
|
Users within the Django authentication system are represented by this
|
||||||
model.
|
model.
|
||||||
|
@ -317,7 +317,7 @@ class User(AbstractBaseUser):
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = _('user')
|
verbose_name = _('user')
|
||||||
verbose_name_plural = _('users')
|
verbose_name_plural = _('users')
|
||||||
swappable = 'AUTH_USER_MODEL'
|
abstract = True
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.username
|
return self.username
|
||||||
|
@ -434,6 +434,9 @@ class User(AbstractBaseUser):
|
||||||
raise SiteProfileNotAvailable
|
raise SiteProfileNotAvailable
|
||||||
return self._profile_cache
|
return self._profile_cache
|
||||||
|
|
||||||
|
class User(AbstractUser):
|
||||||
|
class Meta:
|
||||||
|
swappable = 'AUTH_USER_MODEL'
|
||||||
|
|
||||||
@python_2_unicode_compatible
|
@python_2_unicode_compatible
|
||||||
class AnonymousUser(object):
|
class AnonymousUser(object):
|
||||||
|
|
Loading…
Reference in New Issue