UUIDField now stores as a binary by default (#292)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
---------------
|
||||
|
||||
Reference in New Issue
Block a user