The guts of the sample extender live in person.py
, found in Products.PlumsbergPhrenologyExtender
→ Products
→ PlumsbergPhrenologyExtender
→ person.py
. The operative part, following a few rather dry imports and minor declarations, is the PersonExtender
class, just 25 lines long:
1 class PersonExtender(object): 2 """Adapter that adds a Mobile Phone field to Person. 3 4 You could also change or delete existing fields (though you might violate assumptions made in other code). To do that, implement ISchemaModifier instead of ISchemaExtender. 5 """ 6 adapts(IPerson) 7 implements(ISchemaExtender) 8 9 _fields = [ 10 _StringExtensionField('mobilePhone', 11 required=False, 12 searchable=True, 13 schemata="Contact Information", 14 widget=StringWidget( 15 label=u"Mobile Phone", 16 description=u"Demo field added by the MobilePhoneExtender product.", 17 ) 18 ) 19 ] 20 21 def __init__(self, context): 22 self.context = context 23 24 def getFields(self): 25 return self...