diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2007-07-12 07:45:35 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2007-07-12 07:45:35 +0000 |
| commit | 2d6d20def70dacf4ea783e5a0c8a72266e603bb7 (patch) | |
| tree | fa08081ed0e00e33af408f9e9570b48b1e202a19 /docs/db-api.txt | |
| parent | 090aa5210ebd5ce3c79db95d3f04c95ed346f42a (diff) | |
Fixed #4459 -- Added 'raw' argument to save method, to override any pre-save processing, and modified serializers to use a raw-save. This enables serialization of DateFields with auto_now/auto_now_add. Also modified serializers to invoke save() directly on the model baseclass, to avoid any (potentially order-dependent, data modifying) behavior in a custom save() method.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5658 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/db-api.txt')
| -rw-r--r-- | docs/db-api.txt | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/db-api.txt b/docs/db-api.txt index ef3d811189..feeb708be0 100644 --- a/docs/db-api.txt +++ b/docs/db-api.txt @@ -118,6 +118,23 @@ happens. Explicitly specifying auto-primary-key values is mostly useful for bulk-saving objects, when you're confident you won't have primary-key collision. +Raw saves +--------- + +When you save an Django object, some pre-processing will occur on the the data +that is in the object. For example, if your model has a ``DateField`` with +``auto_now=True`` set, the pre-save phase will alter the data in the object +to ensure that the date field contains the current date stamp. + +Although these automated changes can be very useful, there will be times when +you just want to save the data as-is. In these cases, you can invoke a *Raw Save* +by passing ``raw=True`` as an argument to the ``save()`` method:: + + b4.save(raw=True) # Saves object, but does no pre-processing + +A raw save saves all the data in your object, but performs no pre-save processing +on the data in the object. + Saving changes to objects ========================= |
