Back to index

plone3  3.1.7
Public Member Functions | Static Private Attributes
CMFEditions.StandardModifiers.OMOutsideChildrensModifier Class Reference
Inheritance diagram for CMFEditions.StandardModifiers.OMOutsideChildrensModifier:
Inheritance graph
[legend]
Collaboration diagram for CMFEditions.StandardModifiers.OMOutsideChildrensModifier:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def getOnCloneModifiers
def beforeSaveModifier
def afterRetrieveModifier

Static Private Attributes

tuple __implements__ = (ICloneModifier, ISaveRetrieveModifier)

Detailed Description

ObjectManager modifier treating all childrens as outside refs

Treats all childrens as outside references (the repository layer
knows what to do with that fact).

Definition at line 320 of file StandardModifiers.py.


Member Function Documentation

def CMFEditions.StandardModifiers.OMOutsideChildrensModifier.afterRetrieveModifier (   self,
  obj,
  repo_clone,
  preserve = () 
)

Definition at line 343 of file StandardModifiers.py.

00343 
00344     def afterRetrieveModifier(self, obj, repo_clone, preserve=()):
00345         ref_names = self._getAttributeNamesHandlingSubObjects(obj, repo_clone)
00346 
00347         # Add objects that have been added to the working copy
00348         clone_ids = repo_clone.objectIds()
00349         orig_ids = obj.objectIds()
00350         for attr_name in orig_ids:
00351             if attr_name not in clone_ids:
00352                 new_ob = getattr(obj, attr_name, None)
00353                 if new_ob is not None:
00354                     repo_clone._setOb(attr_name, new_ob)
00355 
00356         # Delete references that are no longer relevant
00357         for attr_name in clone_ids:
00358             if attr_name not in orig_ids:
00359                 try:
00360                     repo_clone._delOb(attr_name)
00361                 except AttributeError:
00362                     pass
00363 
00364         # Restore _objects, so that order is preserved and ids are consistent
00365         orig_objects = getattr(obj, '_objects', None)
00366         if orig_objects is not None:
00367             repo_clone._objects = orig_objects
00368 
00369         return [], ref_names, {}
00370 
00371 InitializeClass(OMOutsideChildrensModifier)
00372 

Here is the call graph for this function:

Returns all unititialized 'IVersionAwareReference' objects.

This allways goes in conjunction with 'getOnCloneModifiers'.

Definition at line 335 of file StandardModifiers.py.

00335 
00336     def beforeSaveModifier(self, obj, clone):
00337         """Returns all unititialized 'IVersionAwareReference' objects.
00338 
00339         This allways goes in conjunction with 'getOnCloneModifiers'.
00340         """
00341         outside_refs = self._beforeSaveModifier(obj, clone)
00342         return {}, [], outside_refs

Here is the call graph for this function:

Removes all childrens and returns them as references.

Definition at line 329 of file StandardModifiers.py.

00329 
00330     def getOnCloneModifiers(self, obj):
00331         """Removes all childrens and returns them as references.
00332         """
00333         pers_id, pers_load, outside_refs = self._getOnCloneModifiers(obj)
00334         return pers_id, pers_load, [], outside_refs, ''

Here is the call graph for this function:


Member Data Documentation

tuple CMFEditions.StandardModifiers.OMOutsideChildrensModifier.__implements__ = (ICloneModifier, ISaveRetrieveModifier) [static, private]

Definition at line 327 of file StandardModifiers.py.


The documentation for this class was generated from the following file: