Loading docs/ref/models/fields.txt +11 −3 Original line number Diff line number Diff line Loading @@ -1002,9 +1002,10 @@ define the details of how the relation works. <abstract-base-classes>`; and when you do so :ref:`some special syntax <abstract-related-name>` is available. If you'd prefer Django didn't create a backwards relation, set ``related_name`` to ``'+'``. For example, this will ensure that the ``User`` model won't get a backwards relation to this model:: If you'd prefer Django not to create a backwards relation, set ``related_name`` to ``'+'`` or end it with ``'+'``. For example, this will ensure that the ``User`` model won't have a backwards relation to this model:: user = models.ForeignKey(User, related_name='+') Loading Loading @@ -1095,6 +1096,13 @@ that control how the relationship functions. Same as :attr:`ForeignKey.related_name`. If you have more than one ``ManyToManyField`` pointing to the same model and want to suppress the backwards relations, set each ``related_name`` to a unique value ending with ``'+'``:: users = models.ManyToManyField(User, related_name='u+') referents = models.ManyToManyField(User, related_name='ref+') .. attribute:: ManyToManyField.limit_choices_to Same as :attr:`ForeignKey.limit_choices_to`. Loading Loading
docs/ref/models/fields.txt +11 −3 Original line number Diff line number Diff line Loading @@ -1002,9 +1002,10 @@ define the details of how the relation works. <abstract-base-classes>`; and when you do so :ref:`some special syntax <abstract-related-name>` is available. If you'd prefer Django didn't create a backwards relation, set ``related_name`` to ``'+'``. For example, this will ensure that the ``User`` model won't get a backwards relation to this model:: If you'd prefer Django not to create a backwards relation, set ``related_name`` to ``'+'`` or end it with ``'+'``. For example, this will ensure that the ``User`` model won't have a backwards relation to this model:: user = models.ForeignKey(User, related_name='+') Loading Loading @@ -1095,6 +1096,13 @@ that control how the relationship functions. Same as :attr:`ForeignKey.related_name`. If you have more than one ``ManyToManyField`` pointing to the same model and want to suppress the backwards relations, set each ``related_name`` to a unique value ending with ``'+'``:: users = models.ManyToManyField(User, related_name='u+') referents = models.ManyToManyField(User, related_name='ref+') .. attribute:: ManyToManyField.limit_choices_to Same as :attr:`ForeignKey.limit_choices_to`. Loading