diff options
| author | Brian Rosner <brosner@gmail.com> | 2008-07-14 05:04:57 +0000 |
|---|---|---|
| committer | Brian Rosner <brosner@gmail.com> | 2008-07-14 05:04:57 +0000 |
| commit | 2624f4ea563e8139c7f19a20d9b723d39b1e6ac1 (patch) | |
| tree | 975193cb2d38ec3369e2688818d41e07660fb40a /docs/db-api.txt | |
| parent | f3cda0b77afb2a6e22520b4c9f1c6d111add6ac9 (diff) | |
newforms-admin: Merged from trunk up to [7917].
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7922 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/db-api.txt')
| -rw-r--r-- | docs/db-api.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/db-api.txt b/docs/db-api.txt index 9a604bf320..5fdcd946bd 100644 --- a/docs/db-api.txt +++ b/docs/db-api.txt @@ -2212,6 +2212,18 @@ updated is that it can only access one database table, the model's main table. So don't try to filter based on related fields or anything like that; it won't work. +Be aware that the ``update()`` method is converted directly to an SQL +statement. It is a bulk operation for direct updates. It doesn't run any +``save()`` methods on your models, or emit the ``pre_save`` or ``post_save`` +signals (which are a consequence of calling ``save()``). If you want to save +every item in a ``QuerySet`` and make sure that the ``save()`` method is +called on each instance, you don't need any special function to handle that. +Just loop over them and call ``save()``: + + for item in my_queryset: + item.save() + + Extra instance methods ====================== |
