summaryrefslogtreecommitdiff
path: root/docs/ref/models
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-05-08 18:07:43 -0400
committerTim Graham <timograham@gmail.com>2016-05-08 18:09:10 -0400
commit145572adb386dc05bc1302bee4432648b13e7e66 (patch)
treec16ab4d1b735d95ab51a845202330f268e7158f8 /docs/ref/models
parent86b346435a6735484c23fc9c798cf5243cbf8124 (diff)
[1.9.x] Fixed #26483 -- Updated docs.python.org links to use Intersphinx.
Backport of f5ff5010cd74500785a707ac70b51d292403cddc from master
Diffstat (limited to 'docs/ref/models')
-rw-r--r--docs/ref/models/instances.txt28
1 files changed, 13 insertions, 15 deletions
diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt
index 7909d9d5c6..5145088401 100644
--- a/docs/ref/models/instances.txt
+++ b/docs/ref/models/instances.txt
@@ -596,8 +596,8 @@ Other model instance methods
A few object methods have special purposes.
-``__str__``
------------
+``__str__()``
+-------------
.. method:: Model.__str__()
@@ -623,8 +623,8 @@ For example::
If you'd like compatibility with Python 2, you can decorate your model class
with :func:`~django.utils.encoding.python_2_unicode_compatible` as shown above.
-``__eq__``
-----------
+``__eq__()``
+------------
.. method:: Model.__eq__()
@@ -652,22 +652,20 @@ For example::
MyModel(id=1) != MultitableInherited(id=1)
MyModel(id=1) != MyModel(id=2)
-``__hash__``
-------------
+``__hash__()``
+--------------
.. method:: Model.__hash__()
-The ``__hash__`` method is based on the instance's primary key value. It
-is effectively hash(obj.pk). If the instance doesn't have a primary key
-value then a ``TypeError`` will be raised (otherwise the ``__hash__``
+The ``__hash__()`` method is based on the instance's primary key value. It
+is effectively ``hash(obj.pk)``. If the instance doesn't have a primary key
+value then a ``TypeError`` will be raised (otherwise the ``__hash__()``
method would return different values before and after the instance is
-saved, but changing the ``__hash__`` value of an instance `is forbidden
-in Python`_).
-
-.. _is forbidden in Python: https://docs.python.org/reference/datamodel.html#object.__hash__
+saved, but changing the :meth:`~object.__hash__` value of an instance is
+forbidden in Python.
-``get_absolute_url``
---------------------
+``get_absolute_url()``
+----------------------
.. method:: Model.get_absolute_url()