Browse files

queryset-refactor: Clarified what the default reverse names are for

ManyToManyFields and ForeignKeys on abstract base classes.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 9d6f0f9 commit 675815d6a1ab6297692e6f9274674b8c8f52fd01 @malcolmt malcolmt committed Apr 24, 2008
Showing with 4 additions and 0 deletions.
  1. +4 −0 docs/model-api.txt
4 docs/model-api.txt
@@ -2185,6 +2185,10 @@ whilst the reverse name of the ``ChildB.m2m`` field will be
construct your related name, but if you forget to use it, Django will raise
errors when you validate your models (or run ``syncdb``).
+If you don't specify a ``related_name`` attribute for a field in an abstract
+base class, the default reverse name will be the name of the child class
+followed by ``'_set'``, just as it normally would be if you'd declared the field directly on the child class. For example, in the above code, if the ``related_name`` attribute was omitted, the reverse name for the ``m2m`` field would be ``childa_set`` in the ``ChildA`` case and ``childb_set`` for the ``ChildB`` field.
Multi-table inheritance

0 comments on commit 675815d

Please sign in to comment.