Loading docs/ref/models/relations.txt +6 −2 Original line number Diff line number Diff line Loading @@ -138,10 +138,14 @@ Related objects reference .. note:: Note that ``add()``, ``create()``, ``remove()``, and ``clear()`` all apply database changes immediately for all types of related fields. In other words, there is no need to call ``save()`` on either end of the apply database changes immediately for all types of related fields. In other words, there is no need to call ``save()`` on either end of the relationship. Also, if you are using :ref:`an intermediate model <intermediary-manytomany>` for a many-to-many relationship, some of the related manager's methods are disabled. .. _direct-assignment: Direct Assignment Loading docs/topics/db/examples/many_to_many.txt +4 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,10 @@ objects, and a ``Publication`` has multiple ``Article`` objects: ordering = ('headline',) What follows are examples of operations that can be performed using the Python API facilities. API facilities. Note that if you are using :ref:`an intermediate model <intermediary-manytomany>` for a many-to-many relationship, some of the related manager's methods are disabled, so some of these examples won't work with such models. Create a couple of ``Publications``:: Loading Loading
docs/ref/models/relations.txt +6 −2 Original line number Diff line number Diff line Loading @@ -138,10 +138,14 @@ Related objects reference .. note:: Note that ``add()``, ``create()``, ``remove()``, and ``clear()`` all apply database changes immediately for all types of related fields. In other words, there is no need to call ``save()`` on either end of the apply database changes immediately for all types of related fields. In other words, there is no need to call ``save()`` on either end of the relationship. Also, if you are using :ref:`an intermediate model <intermediary-manytomany>` for a many-to-many relationship, some of the related manager's methods are disabled. .. _direct-assignment: Direct Assignment Loading
docs/topics/db/examples/many_to_many.txt +4 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,10 @@ objects, and a ``Publication`` has multiple ``Article`` objects: ordering = ('headline',) What follows are examples of operations that can be performed using the Python API facilities. API facilities. Note that if you are using :ref:`an intermediate model <intermediary-manytomany>` for a many-to-many relationship, some of the related manager's methods are disabled, so some of these examples won't work with such models. Create a couple of ``Publications``:: Loading