O'Reilly logo

Professional Plone Development: Building robust, content-centric web applications with Plone 3, an open source Content Management System by Martin Aspeli

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

Modeling with Interfaces

In the previous chapter, we saw how interfaces are usually the first step of detailed design and act as formal documentation of the capabilities of an object. Therefore, we define an interface for each content type as described in the class diagram earlier, all found in the interfaces.py file. For example, the following interfaces describe cinema folders and cinemas:

from zope.interface import Interface from zope import schema from zope.app.container.constraints import contains from optilux.cinemacontent import CinemaMessageFactory as _ class ICinemaFolder(Interface): """A folder containing cinemas """ contains('optilux.cinemacontent.interfaces.ICinema', 'optilux.cinemacontent.interfaces.IPromotion',) title = schema.TextLine(title=_(u"Title"), ...

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