mirror of
https://github.com/Hopiu/django-model-utils.git
synced 2026-04-24 04:44:42 +00:00
Add explicit references for cross-doc file links
This commit is contained in:
parent
85330bc106
commit
1bdf90be20
4 changed files with 11 additions and 3 deletions
|
|
@ -1,6 +1,8 @@
|
|||
Fields
|
||||
======
|
||||
|
||||
.. _StatusField:
|
||||
|
||||
StatusField
|
||||
-----------
|
||||
|
||||
|
|
@ -20,7 +22,7 @@ default value to the first item in the ``STATUS`` choices:
|
|||
# ...
|
||||
status = StatusField()
|
||||
|
||||
(The ``STATUS`` class attribute does not have to be a `Choices`_
|
||||
(The ``STATUS`` class attribute does not have to be a :ref:`Choices`
|
||||
instance, it can be an ordinary list of two-tuples).
|
||||
|
||||
``StatusField`` does not set ``db_index=True`` automatically; if you
|
||||
|
|
@ -29,6 +31,8 @@ enough selectivity to make an index worthwhile) you may want to add this
|
|||
yourself.
|
||||
|
||||
|
||||
.. _MonitorField:
|
||||
|
||||
MonitorField
|
||||
------------
|
||||
|
||||
|
|
|
|||
|
|
@ -80,6 +80,8 @@ This abstract base class just provides self-updating ``created`` and
|
|||
``modified`` fields on any model that inherits from it.
|
||||
|
||||
|
||||
.. _QueryManager:
|
||||
|
||||
QueryManager
|
||||
------------
|
||||
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ within their time range.
|
|||
StatusModel
|
||||
-----------
|
||||
|
||||
Pulls together `StatusField`_, `MonitorField`_ and `QueryManager`_
|
||||
Pulls together :ref:`StatusField`, :ref:`MonitorField` and :ref:`QueryManager`
|
||||
into an abstract base class for any model with a "status."
|
||||
|
||||
Just provide a ``STATUS`` class-attribute (a `Choices`_ object or a
|
||||
Just provide a ``STATUS`` class-attribute (a :ref:`Choices` object or a
|
||||
list of two-tuples), and your model will have a ``status`` field with
|
||||
those choices, a ``status_changed`` field containing the date-time the
|
||||
``status`` was last changed, and a manager for each status that
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
Miscellaneous Utilities
|
||||
=======================
|
||||
|
||||
.. _Choices:
|
||||
|
||||
Choices
|
||||
=======
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue