Exemple #1
0
 def manage_addField(self, id, title, fieldname, REQUEST=None, **options):
     """Add a new field to the form.
     id        -- the id of the field to add
     title     -- the title of the field to add; this will be used in
                  displays of the field on forms
     fieldname -- the name of the field (meta_type) to add
     Result    -- empty string
     """
     title = string.strip(title)
     if not title:
         title = id # title is always required, use id if not provided
     if self.get_unicode_mode():
         # ZMI input is UTF-8 always (?)
         title = ensure_unicode(title)
     # get the field class we want to add
     field_class = FieldRegistry.get_field_class(fieldname)
     # create field instance
     field = field_class(id, title=title, **options)
     # add the field to the form
     id = self._setObject(id, field)
     # respond to add_and_edit button if necessary
     add_and_edit(self, id, REQUEST)
     return ''
def getFieldFactory(fieldname):
    return FieldRegistry.get_field_class(fieldname)
Exemple #3
0
 def get_real_field(self):
     """Get an actual field for this property.
     """
     return apply(FieldRegistry.get_field_class(self.desired_meta_class),
                  (self.id, ), self.kw)
 def get_real_field(self):
     """Get an actual field for this property.
     """
     return apply(FieldRegistry.get_field_class(self.desired_meta_class),
                  (self.id,), self.kw)
def getFieldFactory(fieldname):
    return FieldRegistry.get_field_class(fieldname)