OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __init__ (self, db) |
def | will_copy (self) |
def | transform_incoming (self, son, collection) |
def | transform_outgoing (self, son, collection) |
Data Fields | |
database | |
Transparently reference and de-reference already saved embedded objects. This manipulator should probably only be used when the NamespaceInjector is also being used, otherwise it doesn't make too much sense - documents can only be auto-referenced if they have an *_ns* field. NOTE: this will behave poorly if you have a circular reference. TODO: this only works for documents that are in the same database. To fix this we'll need to add a DatabaseInjector that adds *_db* and then make use of the optional *database* support for DBRefs.
def __init__ | ( | self, | |
db | |||
) |
def transform_incoming | ( | self, | |
son, | |||
collection | |||
) |
Replace embedded documents with DBRefs.
Reimplemented from SONManipulator.
def transform_outgoing | ( | self, | |
son, | |||
collection | |||
) |
Replace DBRefs with embedded documents.
Reimplemented from SONManipulator.
def will_copy | ( | self | ) |
We need to copy so the user's document doesn't get transformed refs.
Reimplemented from SONManipulator.
database |