[Zope-dev] (Errors and omissions in)[??] the Poll product in ZopeDevelopersGuide
Dario Lopez-Kästen
dario@ita.chalmers.se
Thu, 6 Sep 2001 16:06:22 +0200
Hello!
Has anybody had any success in building the Poll product by following the
instructions in the Zope Developers Guide **only**?
I have no luck unless I used previous knowledge. There seem to be a couple
of inconsistensies in the ZDG step-by step.
Here are the things i **think** are wrong (if I am correct that is :-):
on page 29:
last example of the interactive testing:
it is abvious from this line that the author is using a different file than
the book has used so far. The book mentions no "poll2.py" file and, at this
point, there is no method called "castVoteFor", it should be called
"castVote"
on page 30; section "Globals.Persistent":
the example here given is that to trigger the persistency machinery you have
to use the following syntax: self._p_changed = 1
However, on page 34 the final example uses the following syntax
self._votes = self._votes
there is no mention of what this achieves and no mention of why not the
_p_changed attribute is used anymore
on pages 34-35, "Factories and Constructors", the guide goes about
explaining how to add the constructors to the Poll product.
There's a very brief explanation of what factories are but there is no
explanation of what constructors are.
There seem to be a couple of other errors in the examples as well:
on page 35; the addForm method misses the "self" parameter. Shouldn't there
be a docsring in this method to make it publishable?
on page 35; the addFunction method also misses the "self" parameter.
the whole chapter also fails to mention that the addForm and addMethods
should not be defined in the PollProduct class it self, but are rather part
of the PollProduct **module**, that is, they are defined on the top level of
the PollImplementation module /.py file.
There also is no mention of whether the addForm and addFunction modules are
part of the PollImplementation or if they should be defined in the Poll
module/interface file as well.
Also: should there be no security delcarations for the constructors?
Will put this in the sourceforge tracker as well.
Cheers,
/dario
- --------------------------------------------------------------------
Dario Lopez-Kästen Systems Developer Chalmers Univ. of Technology
dario@ita.chalmers.se ICQ will yield no hits IT Systems & Services