mirror of https://github.com/django/django.git
Edited docs/db-api.txt changes from [5658]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5698 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
f9d27b5d0b
commit
0f869d1124
|
@ -121,14 +121,17 @@ objects, when you're confident you won't have primary-key collision.
|
||||||
Raw saves
|
Raw saves
|
||||||
---------
|
---------
|
||||||
|
|
||||||
When you save an Django object, some pre-processing will occur on the the data
|
**New in Django development version**
|
||||||
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
|
When you save an Django object, some pre-processing might occur on the the
|
||||||
you just want to save the data as-is. In these cases, you can invoke a *Raw Save*
|
object's data before it's saved to the database. For example, if your model has
|
||||||
by passing ``raw=True`` as an argument to the ``save()`` method::
|
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 useful, sometimes 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
|
b4.save(raw=True) # Saves object, but does no pre-processing
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue