Commits

mtre...@bcc190cf-cafb-0310-a4f2-bffc1f526a37  committed 4afd003

queryset-refactor: Clarified what the default reverse names are for
ManyToManyFields and ForeignKeys on abstract base classes.

  • Participants
  • Parent commits 99aaf14
  • Branches queryset-refactor

Comments (0)

Files changed (1)

File docs/model-api.txt

 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
 -----------------------