Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Static Private Attributes
Archetypes.Registry.FieldDescription Class Reference

List of all members.

Public Member Functions

def __init__
def allowed_widgets
def properties

Public Attributes

 id
 klass
 default_widget
 title
 description

Static Private Attributes

int __allow_access_to_unprotected_subobjects__ = 1

Detailed Description

Definition at line 43 of file Registry.py.


Constructor & Destructor Documentation

def Archetypes.Registry.FieldDescription.__init__ (   self,
  klass,
  default_widget = None,
  title = '',
  description = '' 
)

Definition at line 48 of file Registry.py.

00048 
00049                  title='', description=''):
00050         self.id = className(klass)
00051         self.klass = klass
00052         default_widget = default_widget or klass._properties.get('widget', None)
00053         if default_widget is None:
00054             raise ValueError, '%r Must have a default_widget' % klass
00055         if type(default_widget) not in [types.StringType, types.UnicodeType]:
00056             default_widget = className(default_widget)
00057         self.default_widget = default_widget
00058         self.title = title or klass.__name__
00059         self.description = description or getDoc(klass)

Here is the caller graph for this function:


Member Function Documentation

Definition at line 60 of file Registry.py.

00060 
00061     def allowed_widgets(self):
00062         from Products.Archetypes.Registry import availableWidgets
00063         widgets = []
00064         for k, v in availableWidgets():
00065             if v.used_for is None or \
00066                self.id in v.used_for:
00067                 widgets.append(k)
00068         return widgets

Definition at line 69 of file Registry.py.

00069 
00070     def properties(self):
00071         from Products.Archetypes.Registry import getPropertyType
00072         props = []
00073         for k, v in self.klass._properties.items():
00074             prop = {}
00075             prop['name'] = k
00076             prop['type'] = getPropertyType(k, self.klass)
00077             prop['default'] = v
00078             props.append(prop)
00079 
00080         return props


Member Data Documentation

Definition at line 45 of file Registry.py.

Definition at line 56 of file Registry.py.

Definition at line 58 of file Registry.py.

Definition at line 49 of file Registry.py.

Definition at line 50 of file Registry.py.

Definition at line 57 of file Registry.py.


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