Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes
Archetypes.Storage.annotation.BaseAnnotationStorage Class Reference
Inheritance diagram for Archetypes.Storage.annotation.BaseAnnotationStorage:
Inheritance graph
[legend]
Collaboration diagram for Archetypes.Storage.annotation.BaseAnnotationStorage:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def get
def set
def unset

Static Public Attributes

tuple security = ClassSecurityInfo()

Private Member Functions

def _migration
def _cleanup

Private Attributes

 _migrate

Static Private Attributes

 __implements__ = IStorage
 _key = None

Detailed Description

Stores data using annotations on the instance

Definition at line 42 of file annotation.py.


Constructor & Destructor Documentation

def Archetypes.Storage.annotation.BaseAnnotationStorage.__init__ (   self,
  migrate = False 
)

Definition at line 52 of file annotation.py.

00052 
00053     def __init__(self, migrate=False):
00054         self._migrate = migrate
        

Here is the caller graph for this function:


Member Function Documentation

def Archetypes.Storage.annotation.BaseAnnotationStorage._cleanup (   self,
  name,
  instance,
  value,
  kwargs 
) [private]
Clean up data in set method

Reimplemented in Archetypes.Storage.annotation.MetadataAnnotationStorage, and Archetypes.Storage.annotation.AnnotationStorage.

Definition at line 60 of file annotation.py.

00060 
00061     def _cleanup(self, name, instance, value, **kwargs):
00062         """Clean up data in set method
00063         """
00064         raise NotImplementedError

Here is the caller graph for this function:

def Archetypes.Storage.annotation.BaseAnnotationStorage._migration (   self,
  name,
  instance,
  kwargs 
) [private]
Migrates data from the original storage

Reimplemented in Archetypes.Storage.annotation.MetadataAnnotationStorage, and Archetypes.Storage.annotation.AnnotationStorage.

Definition at line 55 of file annotation.py.

00055 
00056     def _migration(self, name, instance, **kwargs):
00057         """Migrates data from the original storage
00058         """
00059         raise NotImplementedError
        

Here is the caller graph for this function:

def Archetypes.Storage.annotation.BaseAnnotationStorage.get (   self,
  name,
  instance,
  kwargs 
)

Definition at line 66 of file annotation.py.

00066 
00067     def get(self, name, instance, **kwargs):
00068         ann = getAnnotation(instance)
00069         value = ann.getSubkey(self._key, subkey=name, default=_marker)
00070         if value is _marker:
00071             if self._migrate:
00072                 value = self._migration(name, instance, **kwargs)
00073             else:
00074                 raise AttributeError(name)
00075         return value

Here is the call graph for this function:

Here is the caller graph for this function:

def Archetypes.Storage.annotation.BaseAnnotationStorage.set (   self,
  name,
  instance,
  value,
  kwargs 
)

Definition at line 77 of file annotation.py.

00077 
00078     def set(self, name, instance, value, **kwargs):
00079         # Remove acquisition wrappers
00080         value = aq_base(value)
00081         ann = getAnnotation(instance)
00082         ann.setSubkey(self._key, value, subkey=name)
00083         if self._migrate:
00084             self._cleanup(name, instance, value, **kwargs) 

Here is the call graph for this function:

Here is the caller graph for this function:

def Archetypes.Storage.annotation.BaseAnnotationStorage.unset (   self,
  name,
  instance,
  kwargs 
)

Definition at line 86 of file annotation.py.

00086 
00087     def unset(self, name, instance, **kwargs):
00088         ann = getAnnotation(instance)
00089         try:
00090             ann.delSubkey(self._key, subkey=name)
00091         except KeyError:
00092             pass
00093 
00094 setSecurity(BaseAnnotationStorage)

Here is the call graph for this function:


Member Data Documentation

Reimplemented in Archetypes.Storage.annotation.MetadataAnnotationStorage.

Definition at line 46 of file annotation.py.

Definition at line 53 of file annotation.py.


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