summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-05-10 11:44:25 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-05-10 11:44:25 +0000
commit0765d4b59774b5484d2be408f26a398f0144d578 (patch)
tree117be15ccedccd0320c1873391c9e20388e647c9 /docs
parent45c409f3fd488c59077dbb0acc0fea121b048579 (diff)
[1.1.X] Fixed #13158 -- Clarified that OneToOneField is a better option for User profile classes. Thanks to hvdklauw for the report and patch.
Backport of r13197 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@13200 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
-rw-r--r--docs/topics/auth.txt17
1 files changed, 9 insertions, 8 deletions
diff --git a/docs/topics/auth.txt b/docs/topics/auth.txt
index 7f9252db81..4c7f716be6 100644
--- a/docs/topics/auth.txt
+++ b/docs/topics/auth.txt
@@ -222,7 +222,7 @@ Methods
.. method:: models.User.has_perms(perm_list)
Returns ``True`` if the user has each of the specified permissions,
- where each perm is in the format
+ where each perm is in the format
``"<app label>.<permission codename>"``. If the user is inactive,
this method will always return ``False``.
@@ -264,7 +264,7 @@ Manager functions
.. method:: models.UserManager.create_user(username, email, password=None)
Creates, saves and returns a :class:`~django.contrib.auth.models.User`.
-
+
The :attr:`~django.contrib.auth.models.User.username` and
:attr:`~django.contrib.auth.models.User.password` are set as given. The
domain portion of :attr:`~django.contrib.auth.models.User.email` is
@@ -446,12 +446,13 @@ If you'd like to store additional information related to your users, Django
provides a method to specify a site-specific related model -- termed a "user
profile" -- for this purpose.
-To make use of this feature, define a model with fields for the additional
-information you'd like to store, or additional methods you'd like to have
-available, and also add a :class:`~django.db.models.Field.ForeignKey` from your
-model to the :class:`~django.contrib.auth.models.User` model, specified with
-``unique=True`` to ensure only one instance of your model can be created for
-each :class:`~django.contrib.auth.models.User`.
+To make use of this feature, define a model with fields for the
+additional information you'd like to store, or additional methods
+you'd like to have available, and also add a
+:class:`~django.db.models.Field.OneToOneField` from your model to the
+:class:`~django.contrib.auth.models.User` model. This will ensure only
+one instance of your model can be created for each
+:class:`~django.contrib.auth.models.User`.
To indicate that this model is the user profile model for a given site, fill in
the setting :setting:`AUTH_PROFILE_MODULE` with a string consisting of the