Errata of the First Edition
Thanks to everyone who reported errata and typos.
page 51, Table 4.2: The last row, mentioning the allowed_values parameter for fields, corresponds to an outdated version of the zope.schema package that featured enumerated field types. It does no longer apply. Reported by Joel Moxley (r1520)
page 56: The import of IAttributeAnnotatable in the interpreter example at the bottom of the page is wrong. The import path must be:
>>> from zope.app.annotation.interfaces import IAttributeAnnotatable
Reported by George Yoshida (r1290)
pages 60 through 63: When validation fails, not ValidationError is raised but an exception specific to the validation problem. The explanations and interpreter examples regarding ValidationError are outdated.
The exception raised in the interpreter examples on pages 60 and 63 should be WrongType. The following table listing other validation exceptions from the zope.schema package is missing entirely:
Exception name
Description
RequiredMissing
Indicates that input for a required field is missing.
WrongType
The value has a wrong type (raised, for example, when assigning a string object to an integer field).
TooBig
The provided value is too big (typically raised for numeric fields with range limitations).
TooSmall
The provided value is too small (typically raised for numeric fields with range limitations).
TooLong
The provided text is too long.
TooShort
The provided text is too short.
InvalidValue
Simply indicates that the provided value is invalid.
ConstraintNotSatisfied
A field constraint was not satisfied.
NotAContainer
The object in question is not a container (raised by the Container field).
NotAnIterator
The object in question is not an iterator (raised by the Iteratable field.
WrongContainedType
Object within a collection (for example a list or a tuple) is of the wrong type.
NotUnique
One or more objects in a collection that is required to have unique entries are not unique.
SchemaNotFullyImplemented
Raised by the Object field to indicate that the object in question does not fully implement the promised schema.
SchemaNotProvided
Raised by the Object field to indicate that the object in question does not provide the promised schema.
InvalidURI
Raised by the URI field when passed value is not a valid URI.
InvalidId
Raised by the Id field when passed value is neither a dotted name nor a valid URI.
InvalidDottedName
Raised by the DottedName field when passed value is not a valid dotted name.
Fixed in r1253, r1304.
page 85, the explanation for not: states that everything except the number 0, an empty string, list, tuple, or dictionary and None are treated as False. This, of course, is wrong. Everything except the aforementioned items evaluates to True. Reported by Erwin Ambrosch (r1955)
page 96, Example 7.4.1: Due to an incompatible change from Zope 3.1 to Zope 3.2, The custom sequence widget no longer works as listed. Adding the following code to the widget class fixes the problem:
def __init__(self, context, value_type, request): return super(DynamicSequenceWidget, self).__init__(context, request)page 114, Example 8.2.3, line 17: The slot that is redefined should be called global, not globals. Reported by Ivo van der Wijk (r1272)
page 177, step 2: The name of the principal configuration file is not etc/prinicipals.zcml but should be etc/principals.zcml (r1393)
page 204, Example 12.24, line 17: Using the write() method of HTTP-based responses does not provide a performance advantage in Zope X3 3.0 and 3.1 and is not supported anymore in Zope 3.2 and higher. To effectively return large data without holding it in memory, it is now recommended to create a temporary file and return that:
import tempfile f = tempfile.TemporaryFile() f.write(pdf.data) return f
This will only work with Zope 3.2 and higher. Reported by Adam Summers.
page 208, Example 12.4.4: The example's title claims that the shown code is a Python script while in fact it is the Java program that retrieves recipe data via XML-RPC. Reported by Ivo van der Wijk (r1271)
page 217: In the interpreter example at the top of the page, the initialization of the Debugger class is incomplete. It should read:
>>> debugger = Debugger(db="var/Data.fs", config_file="etc/site.zcml")
Fixed in r1305.
page 235: The gazpacho variable is incorrectly initialized in the interpreter example on the bottom of the page. Instead of:
>>> gazpacho = SampleContainer()
the line should read:
>>> container = SampleContainer()
Reported by Pete Taylor and Martijn Pieters (r1291)
page 236: The contained function used in the first interpreter example on the page is not imported. The following line in front of the example is missing:
>>> from zope.app.container.contained import contained
Reported by Pete Taylor (r1368)
page 274, Example 15.3.7: Explanation to lines 3 and 39 points to line 30 in the doctest (Example 15.3.6) whereas it really should point to line 49 (and possibly even lines 36 and 37) (r1253)
page 355: While the list of parameters for the createObject ZAPI function correctly includes the context parameter which is even explained in detail in the Description section, the example at the bottom of the page omits it. It should really read:
>>> zapi.createObject(None, 'Recipe')
Reported by Andreas Jung (r1266)
pages 407 and 409: the for parameter of the browser:menuItem and browser:menuItems directives is not declared as required (not even in Zope X3 3.0.0) while it actually is required. This has been fixed for Zope X3 3.0.1 and Zope 3.1. (r1260)
page 415: the permission parameter for browser:resource is declared as required while it is in fact not required. It defaults to zope.Public. Reported by Richard Waid (r1874)
page 451: the reference page for the zope:subscriber ZCML directive is missing entirely. A PDF document with the missing page is provided for your convenience (r1399)