mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Improved queryset handling and docs for (Single|Multiple)ObjectMixin.
This commit is contained in:
parent
8442268869
commit
f8a6a4eba1
4 changed files with 42 additions and 14 deletions
|
@ -63,6 +63,14 @@ MultipleObjectMixin
|
|||
A ``QuerySet`` that represents the objects. If provided, the value of
|
||||
``queryset`` supersedes the value provided for :attr:`model`.
|
||||
|
||||
.. warning::
|
||||
|
||||
``queryset`` is a class attribute with a *mutable* value so care
|
||||
must be taken when using it directly. Before using it, either call
|
||||
its :meth:`~django.db.models.query.QuerySet.all` method or
|
||||
retrieve it with :meth:`get_queryset` which takes care of the
|
||||
cloning behind the scenes.
|
||||
|
||||
.. attribute:: paginate_by
|
||||
|
||||
An integer specifying how many objects should be displayed per page. If
|
||||
|
|
|
@ -23,6 +23,14 @@ SingleObjectMixin
|
|||
A ``QuerySet`` that represents the objects. If provided, the value of
|
||||
``queryset`` supersedes the value provided for :attr:`model`.
|
||||
|
||||
.. warning::
|
||||
|
||||
``queryset`` is a class attribute with a *mutable* value so care
|
||||
must be taken when using it directly. Before using it, either call
|
||||
its :meth:`~django.db.models.query.QuerySet.all` method or
|
||||
retrieve it with :meth:`get_queryset` which takes care of the
|
||||
cloning behind the scenes.
|
||||
|
||||
.. attribute:: slug_field
|
||||
|
||||
The name of the field on the model that contains the slug. By default,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue