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

Add the fax and publications fields

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

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