Besides the constructor above, a schema extender really requires only one function:
getFields, which returns a list of fields to add.
24 def getFields(self): 25 return self._fields
The list of fields doesn't live within the
getFields method; it comes instead from the
_fields attribute of the class. We could have written
getFields like this...
def getFields(self): return [ _StringExtensionField('mobilePhone', required=False, searchable=True, schemata="Contact Information", widget=StringWidget( label=u"Mobile Phone", description=u"Demo field added by the MobilePhoneExtender product.", ) ) ]
...and it would have worked, but it would also have been deathly slow, as it would require the expensive construction of ...