O'Reilly logo

Plone 3 for Education by Erik Rose

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adapters: the anatomy of an Extender

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", ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required