Back to index

plone3  3.1.7
Public Member Functions
Archetypes.Schema.Facade.CMFMetadataFieldsDescriptor Class Reference

List of all members.

Public Member Functions

def __get__

Detailed Description

A nice descriptor that computes a set of Archetypes
fields from a CMFMetadata Set (Formulator-based)

Definition at line 65 of file Facade.py.


Member Function Documentation

def Archetypes.Schema.Facade.CMFMetadataFieldsDescriptor.__get__ (   self,
  obj,
  objtype = None 
)

Definition at line 69 of file Facade.py.

00069 
00070     def __get__(self, obj, objtype=None):
00071         pm = getToolByName(obj.context, 'portal_metadata', None)
00072         if pm is None:
00073             return {}
00074         set = pm.getMetadataSet(obj.set_id)
00075         fields = fieldsFromSet(set, obj)
00076         # TODO This would *really* benefit from some
00077         # caching/timestamp checking.
00078         # Calling generateMethods and reconstructing
00079         # the fields each time may actually be
00080         # *very very* expensive.
00081         klass = obj.context.__class__
00082         generateMethods(klass, fields.values())
00083         return fields

Here is the call graph for this function:


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