Errata of the Second Edition

Thanks to everyone who reported errata and typos.

  • page 53, Example 4.3.1: Line 14 misspells the time_to_cook attribute. It should read:

    self.time_to_cook = self.time_to_cook
    

    Reported by Lucie Lejard.

  • page 56, first interpreter example: The import of directlyProvides is not shown. It can be imported as follows:

    >>> from zope.interface import directlyProvides
    

    Reported by Kent Tenney.

  • page 57, last interpreter example: The constructor of the RecipeInfo class expects a number of parameters, it cannot simply be instantiated by calling RecipeInfo(). A solution would be to change the constructor of the RecipeInfo class to be more forgiving:

    class RecipeInfo(object):
        def __init__(self, name=u'', ingredients=[], tools=[],
                     time_to_cook=0, description=u''):
            ...
    
  • pages 61 and page 425 (Example 22.4.1): The regular expression for validating email addresses is a bit too forgiving. It lacks the begin and end constraints (^ and $) and should read:

    regex = r"^[a-zA-Z0-9._%-]+@([a-zA-Z0-9-]+\.)*[a-zA-Z]{2,4}$"
    

    Reported by Jørgen Jørgensen.

  • page 74, Summary: The third bullet point refers to the no-longer used content directive. The class directive is meant here. Reported by Tim Terlegård

  • page 91, last paragraph: PersistentList is mentioned twice (PersistentList and PersistentList) while the text meant to say "PersistentList and PersistentDict." Reported by Tim Terlegård.

  • page 121, Example 8.1.6: Line 5 wrongly registers the adapter as worldcookery.editform. It should read:

    name="worldcookery.form"
    
  • page 310, Example 16.2.1: Line 29 should read:

    info = Attributes(IRating, 'averageRating', 'numberOfRatings')
    
  • page 384, second block of interpreter examples: The registration of the session adapter with:

    >>> provideAdapter(Session)
    

    fails. Instead, the following two lines should be used:

    >>> from zope.app.session.interfaces import ISession
    >>> provideAdapter(Session, provides=ISession)
    

    Reported by Volker Bachschneider.

  • page 522, explanation of the template parameter for browser:viewletManager: The Page Template that is used to render the viewlet manager can access the viewlets using options/viewlets (not options/viewlet), which returns an iterable of the manager's viewlets.