diff options
| author | Tim Graham <timograham@gmail.com> | 2013-01-10 15:16:25 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-01-10 15:16:25 -0500 |
| commit | 4da5947a876a4ec2cba9de8b0ef1513832328c67 (patch) | |
| tree | a984c77d5e6b71c2102fa4eef06eda99b1612153 /docs | |
| parent | cdad0b28d49eecb13773c112410f3c126fdd1625 (diff) | |
Fixed #19588 - Added create_superuser to UserManager docs.
Thanks minddust for the report.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/contrib/auth.txt | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/docs/ref/contrib/auth.txt b/docs/ref/contrib/auth.txt index e35a5b3586..f871f1493f 100644 --- a/docs/ref/contrib/auth.txt +++ b/docs/ref/contrib/auth.txt @@ -218,9 +218,10 @@ Manager methods .. class:: models.UserManager The :class:`~django.contrib.auth.models.User` model has a custom manager - that has the following helper methods: + that has the following helper methods (in addition to the methods provided + by :class:`~django.contrib.auth.models.BaseUserManager`): - .. method:: create_user(username, email=None, password=None) + .. method:: create_user(username, email=None, password=None, **extra_fields) Creates, saves and returns a :class:`~django.contrib.auth.models.User`. @@ -235,18 +236,17 @@ Manager methods :meth:`~django.contrib.auth.models.User.set_unusable_password()` will be called. - See :ref:`Creating users <topics-auth-creating-users>` for example usage. + The ``extra_fields`` keyword arguments are passed through to the + :class:`~django.contrib.auth.models.User`'s ``__init__`` method to + allow setting arbitrary fields on a :ref:`custom User model + <auth-custom-user>`. - .. method:: make_random_password(length=10, allowed_chars='abcdefghjkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789') + See :ref:`Creating users <topics-auth-creating-users>` for example usage. - Returns a random password with the given length and given string of - allowed characters. (Note that the default value of ``allowed_chars`` - doesn't contain letters that can cause user confusion, including: + .. method:: create_superuser(self, username, email, password, **extra_fields) - * ``i``, ``l``, ``I``, and ``1`` (lowercase letter i, lowercase - letter L, uppercase letter i, and the number one) - * ``o``, ``O``, and ``0`` (uppercase letter o, lowercase letter o, - and zero) + Same as :meth:`create_user`, but sets :attr:`~models.User.is_staff` and + :attr:`~models.User.is_superuser` to ``True``. Anonymous users |
