Django

Code

Changeset 5437

Show
Ignore:
Timestamp:
06/07/07 13:24:27 (1 year ago)
Author:
jacob
Message:

Fixed #4214: added a bit of explicit info on updating FK fields to db-api.txt. Thanks, david@kazserve.org.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/db-api.txt

    r5431 r5437  
    134134 
    135135The ``save()`` method has no return value. 
     136 
     137Updating ``ForeignKey`` fields works exactly the same way; simply assign an 
     138object of the right type to the field in question:: 
     139 
     140    joe = Author.objects.create(name="Joe") 
     141    entry.author = joe 
     142    entry.save() 
     143     
     144Django will complain if you try to assign an object of the wrong type. 
    136145 
    137146How Django knows to UPDATE vs. INSERT