summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/models/instances.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt
index 1524ad2fcd..6adcb979ba 100644
--- a/docs/ref/models/instances.txt
+++ b/docs/ref/models/instances.txt
@@ -834,6 +834,15 @@ Note that in the case of identical date values, these methods will use the
primary key as a tie-breaker. This guarantees that no records are skipped or
duplicated. That also means you cannot use those methods on unsaved objects.
+.. admonition:: Overriding extra instance methods
+
+ In most cases overriding or inheriting ``get_FOO_display()``,
+ ``get_next_by_FOO()``, and ``get_previous_by_FOO()` should work as
+ expected. Since they are added by the metaclass however, it is not
+ practical to account for all possible inheritance structures. In more
+ complex cases you should override ``Field.contribute_to_class()`` to set
+ the methods you need.
+
Other attributes
================