Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
PlonePAS.sheet.PropertySchemaTypeMap Class Reference

List of all members.

Public Member Functions

def __init__
def addType
def getTypeFor
def validate

Public Attributes

 tmap
 tmap_order

Detailed Description

Definition at line 37 of file sheet.py.


Constructor & Destructor Documentation

Definition at line 39 of file sheet.py.

00039 
00040     def __init__(self):
00041         self.tmap = {}
00042         self.tmap_order = []


Member Function Documentation

def PlonePAS.sheet.PropertySchemaTypeMap.addType (   self,
  type_name,
  identifier,
  order = None 
)

Definition at line 43 of file sheet.py.

00043 
00044     def addType(self, type_name, identifier, order=None):
00045         self.tmap[type_name] = identifier
00046         if order is not None and isinstance(order, int):
00047             self.tmap_order.insert(order, type_name)
00048         else:
00049             self.tmap_order.append(type_name)

Definition at line 50 of file sheet.py.

00050 
00051     def getTypeFor(self, value):
00052         ptypes = [(ptype, self.tmap[ptype]) for ptype in self.tmap_order]
00053         for ptype, inspector in ptypes:
00054             if inspector(value):
00055                 return ptype
00056         raise TypeError, 'Invalid property type: %s' % type(value)

def PlonePAS.sheet.PropertySchemaTypeMap.validate (   self,
  property_type,
  value 
)

Definition at line 57 of file sheet.py.

00057 
00058     def validate(self, property_type, value):
00059         inspector = self.tmap[property_type]
00060         return inspector(value)

Here is the caller graph for this function:


Member Data Documentation

Definition at line 40 of file sheet.py.

Definition at line 41 of file sheet.py.


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