def manage_addField(self, id, title, fieldname, REQUEST=None): """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 # get the field class we want to add field_class = FieldRegistry.get_field_class(fieldname) # create field instance field = field_class(id, title=title, description="") # 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 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)