1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[1.8.x] Fixed #24289 -- Reversed usage of Field.many_to_one and one_to_many.

Thanks Carl Meyer and Tim Graham for the reviews and to all involved
in the discussion.

Backport of 18c0aaa912 from master
This commit is contained in:
Loic Bistuer
2015-02-14 01:55:36 +07:00
parent 136edac897
commit 20b621eb3c
8 changed files with 34 additions and 34 deletions

View File

@@ -1863,16 +1863,6 @@ relation. These attribute are present on all fields; however, they will only
have meaningful values if the field is a relation type
(:attr:`Field.is_relation=True <Field.is_relation>`).
.. attribute:: Field.one_to_many
Boolean flag that is ``True`` if the field has a one-to-many relation, such
as a ``ForeignKey``; ``False`` otherwise.
.. attribute:: Field.one_to_one
Boolean flag that is ``True`` if the field has a one-to-one relation, such
as a ``OneToOneField``; ``False`` otherwise.
.. attribute:: Field.many_to_many
Boolean flag that is ``True`` if the field has a many-to-many relation;
@@ -1882,9 +1872,19 @@ have meaningful values if the field is a relation type
.. attribute:: Field.many_to_one
Boolean flag that is ``True`` if the field has a many-to-one relation, such
as a ``ForeignKey``; ``False`` otherwise.
.. attribute:: Field.one_to_many
Boolean flag that is ``True`` if the field has a one-to-many relation, such
as a ``GenericRelation`` or the reverse of a ``ForeignKey``; ``False``
otherwise.
.. attribute:: Field.one_to_one
Boolean flag that is ``True`` if the field has a one-to-one relation, such
as a ``OneToOneField``; ``False`` otherwise.
.. attribute:: Field.related_model
Points to the model the field relates to. For example, ``Author`` in