UUIDField now stores as a binary by default (#292)

This commit is contained in:
Ross Lawley
2013-04-25 13:43:56 +00:00
parent d0d9c3ea26
commit ac6e793bbe
8 changed files with 109 additions and 333 deletions

View File

@@ -4,6 +4,7 @@ Changelog
Changes in 0.8.X
================
- UUIDField now stores as a binary by default (#292)
- Added Custom User Model for Django 1.5 (#285)
- Cascading saves now default to off (#291)
- ReferenceField now store ObjectId's by default rather than DBRef (#290)

View File

@@ -120,6 +120,30 @@ eg::
p._mark_as_dirty('friends')
p.save()
UUIDField
---------
UUIDFields now default to storing binary values::
# Old code
class Animal(Document):
uuid = UUIDField()
# New code
class Animal(Document):
uuid = UUIDField(binary=False)
To migrate all the uuid's you need to touch each object and mark it as dirty
eg::
# Doc definition
class Animal(Document):
uuid = UUIDField()
# Mark all ReferenceFields as dirty and save
for a in Animal.objects:
a._mark_as_dirty('uuid')
a.save()
Cascading Saves
---------------