mirror of https://github.com/django/django.git
[1.6.x] Fixed #23314 -- Tempered recommendation of storing profile data on custom user.
Thanks gavinwahl for the report.
Backport of 3569536491
from master
This commit is contained in:
parent
3cd3b49eb5
commit
18f25efc9e
|
@ -451,6 +451,8 @@ different User model.
|
||||||
class Article(models.Model):
|
class Article(models.Model):
|
||||||
author = models.ForeignKey(settings.AUTH_USER_MODEL)
|
author = models.ForeignKey(settings.AUTH_USER_MODEL)
|
||||||
|
|
||||||
|
.. _specifying-custom-user-model:
|
||||||
|
|
||||||
Specifying a custom User model
|
Specifying a custom User model
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
|
@ -691,10 +693,12 @@ Extending Django's default User
|
||||||
-------------------------------
|
-------------------------------
|
||||||
|
|
||||||
If you're entirely happy with Django's :class:`~django.contrib.auth.models.User`
|
If you're entirely happy with Django's :class:`~django.contrib.auth.models.User`
|
||||||
model and you just want to add some additional profile information, you can
|
model and you just want to add some additional profile information, you could
|
||||||
simply subclass ``django.contrib.auth.models.AbstractUser`` and add your
|
simply subclass ``django.contrib.auth.models.AbstractUser`` and add your
|
||||||
custom profile fields. This class provides the full implementation of the
|
custom profile fields, although we'd recommend a separate model as described in
|
||||||
default :class:`~django.contrib.auth.models.User` as an :ref:`abstract model
|
the "Model design considerations" note of :ref:`specifying-custom-user-model`.
|
||||||
|
``AbstractUser`` provides the full implementation of the default
|
||||||
|
:class:`~django.contrib.auth.models.User` as an :ref:`abstract model
|
||||||
<abstract-base-classes>`.
|
<abstract-base-classes>`.
|
||||||
|
|
||||||
.. _custom-users-and-the-built-in-auth-forms:
|
.. _custom-users-and-the-built-in-auth-forms:
|
||||||
|
|
Loading…
Reference in New Issue