mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #23488 -- Added AnonymousUser.get_username().
This commit is contained in:
parent
8facb02faf
commit
ad491ecc6e
3 changed files with 17 additions and 0 deletions
|
@ -269,6 +269,10 @@ Anonymous users
|
|||
these differences:
|
||||
|
||||
* :ref:`id <automatic-primary-key-fields>` is always ``None``.
|
||||
* :attr:`~django.contrib.auth.models.User.username` is always the empty
|
||||
string.
|
||||
* :meth:`~django.contrib.auth.models.User.get_username()` always returns
|
||||
the empty string.
|
||||
* :attr:`~django.contrib.auth.models.User.is_staff` and
|
||||
:attr:`~django.contrib.auth.models.User.is_superuser` are always
|
||||
``False``.
|
||||
|
@ -285,6 +289,11 @@ Anonymous users
|
|||
:meth:`~django.db.models.Model.save` and
|
||||
:meth:`~django.db.models.Model.delete()` raise :exc:`NotImplementedError`.
|
||||
|
||||
.. versionadded:: 1.8
|
||||
|
||||
``AnonymousUser.get_username()`` has been added to
|
||||
better mirror :class:`django.contrib.auth.models.User`.
|
||||
|
||||
In practice, you probably won't need to use
|
||||
:class:`~django.contrib.auth.models.AnonymousUser` objects on your own, but
|
||||
they're used by Web requests, as explained in the next section.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue