mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #36329 -- Removed non-code custom link text when cross-referencing Python objects.
Thanks Bruno Alla, Sarah Boyce, and Jacob Walls for reviews. Co-authored-by: Sarah Boyce <42296566+sarahboyce@users.noreply.github.com>
This commit is contained in:
@@ -646,10 +646,8 @@ The following backends are available in :mod:`django.contrib.auth.backends`:
|
||||
.. method:: user_can_authenticate()
|
||||
|
||||
Returns whether the user is allowed to authenticate. To match the
|
||||
behavior of :class:`~django.contrib.auth.forms.AuthenticationForm`
|
||||
which :meth:`prohibits inactive users from logging in
|
||||
<django.contrib.auth.forms.AuthenticationForm.confirm_login_allowed>`,
|
||||
this method returns ``False`` for users with :attr:`is_active=False
|
||||
behavior of :meth:`.AuthenticationForm.confirm_login_allowed`, this
|
||||
method returns ``False`` for users with :attr:`is_active=False
|
||||
<django.contrib.auth.models.User.is_active>`. Custom user models that
|
||||
don't have an :attr:`~django.contrib.auth.models.CustomUser.is_active`
|
||||
field are allowed.
|
||||
|
||||
@@ -110,8 +110,7 @@ model it represents, or to retrieve objects from that model:
|
||||
|
||||
Takes a set of valid :ref:`lookup arguments <field-lookups-intro>` for the
|
||||
model the :class:`~django.contrib.contenttypes.models.ContentType`
|
||||
represents, and does
|
||||
:meth:`a get() lookup <django.db.models.query.QuerySet.get>`
|
||||
represents, and does a :meth:`~django.db.models.query.QuerySet.get` lookup
|
||||
on that model, returning the corresponding object. The ``using`` argument
|
||||
can be used to specify a different database than the default one.
|
||||
|
||||
@@ -160,11 +159,10 @@ two extremely important use cases:
|
||||
to get access to those model classes.
|
||||
|
||||
Several of Django's bundled applications make use of the latter technique.
|
||||
For example,
|
||||
:class:`the permissions system <django.contrib.auth.models.Permission>` in
|
||||
Django's authentication framework uses a
|
||||
:class:`~django.contrib.auth.models.Permission` model with a foreign
|
||||
key to :class:`~django.contrib.contenttypes.models.ContentType`; this lets
|
||||
For example, :ref:`the permissions system <topic-authorization>` in Django's
|
||||
authentication framework uses a :class:`~django.contrib.auth.models.Permission`
|
||||
model with a foreign key to
|
||||
:class:`~django.contrib.contenttypes.models.ContentType`; this lets
|
||||
:class:`~django.contrib.auth.models.Permission` represent concepts like
|
||||
"can add blog entry" or "can delete news story".
|
||||
|
||||
|
||||
@@ -338,9 +338,9 @@ than comparing the size of an integer, for example.
|
||||
|
||||
In the event that all the fields you're querying on are contained within one
|
||||
particular model, you can create a functional
|
||||
:class:`GIN <django.contrib.postgres.indexes.GinIndex>` or
|
||||
:class:`GiST <django.contrib.postgres.indexes.GistIndex>` index which matches
|
||||
the search vector you wish to use. For example::
|
||||
:class:`~django.contrib.postgres.indexes.GinIndex` or
|
||||
:class:`~django.contrib.postgres.indexes.GistIndex` which matches the search
|
||||
vector you wish to use. For example::
|
||||
|
||||
GinIndex(
|
||||
SearchVector("body_text", "headline", config="english"),
|
||||
|
||||
Reference in New Issue
Block a user