Ticket #5068: 5068.patch
File 5068.patch, 833 bytes (added by , 17 years ago) |
---|
-
docs/db-api.txt
207 207 208 208 The ``save()`` method has no return value. 209 209 210 Updating ``ForeignKey`` fields works exactly the same way; simply assign an211 object of the right type to the field in question::210 Updating a ``ManyToManyField`` works a little different; use the ``add()`` 211 method on the field to add a record to the relation:: 212 212 213 213 joe = Author.objects.create(name="Joe") 214 entry.author = joe 215 entry.save() 214 entry.authors.add(joe) 216 215 217 Django will complain if you try to a ssignan object of the wrong type.216 Django will complain if you try to add an object of the wrong type. 218 217 219 218 How Django knows to UPDATE vs. INSERT 220 219 -------------------------------------