Cascading saves now default to off (#291)

This commit is contained in:
Ross Lawley
2013-04-25 10:24:33 +00:00
parent c60ea40828
commit fe62c3aacb
5 changed files with 58 additions and 40 deletions

View File

@@ -4,6 +4,7 @@ Changelog
Changes in 0.8.X
================
- Cascading saves now default to off (#291)
- ReferenceField now store ObjectId's by default rather than DBRef (#290)
- Added ImageField support for inline replacements (#86)
- Added SequenceField.set_next_value(value) helper (#159)

View File

@@ -5,11 +5,21 @@ Upgrading
0.7 to 0.8
**********
Inheritance
===========
There have been numerous backwards breaking changes in 0.8. The reasons for
these are ensure that MongoEngine has sane defaults going forward and
performs the best it can out the box. Where possible there have been
FutureWarnings to help get you ready for the change, but that hasn't been
possible for the whole of the release.
.. warning:: Breaking changes - test upgrading on a test system before putting
live. There maybe multiple manual steps in migrating and these are best honed
on a staging / test system.
Data Model
----------
==========
Inheritance
-----------
The inheritance model has changed, we no longer need to store an array of
:attr:`types` with the model we can just use the classname in :attr:`_cls`.
@@ -105,6 +115,21 @@ eg::
p._mark_as_dirty('friends')
p.save()
Cascading Saves
---------------
To improve performance document saves will no longer automatically cascade.
Any changes to a Documents references will either have to be saved manually or
you will have to explicitly tell it to cascade on save::
# At the class level:
class Person(Document):
meta = {'cascade': True}
# Or on save:
my_document.save(cascade=True)
Querysets
=========