pymongo::son_manipulator::AutoReference Class Reference

Inheritance diagram for pymongo::son_manipulator::AutoReference:
Inheritance graph
[legend]

List of all members.

Public Member Functions

def __init__
def transform_incoming
def transform_outgoing
def will_copy

Private Attributes

 __database

Detailed Description

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.

Definition at line 110 of file son_manipulator.py.


Member Function Documentation

def pymongo::son_manipulator::AutoReference::__init__ (   self,
  db 
)

Definition at line 124 of file son_manipulator.py.

def pymongo::son_manipulator::AutoReference::transform_incoming (   self,
  son,
  collection 
)
Replace embedded documents with DBRefs.

Reimplemented from pymongo::son_manipulator::SONManipulator.

Definition at line 132 of file son_manipulator.py.

def pymongo::son_manipulator::AutoReference::transform_outgoing (   self,
  son,
  collection 
)
Replace DBRefs with embedded documents.

Reimplemented from pymongo::son_manipulator::SONManipulator.

Definition at line 153 of file son_manipulator.py.

def pymongo::son_manipulator::AutoReference::will_copy (   self  ) 
We need to copy so the user's document doesn't get transformed refs.

Reimplemented from pymongo::son_manipulator::SONManipulator.

Definition at line 127 of file son_manipulator.py.


Member Data Documentation

Definition at line 125 of file son_manipulator.py.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines


pymongo
Author(s): Bhaskara Marthi
autogenerated on Fri Jan 11 10:09:06 2013