[ZDP] BackTalk to Document Zope Developer's Guide (2.4 edition)/Zope Products

webmaster@zope.org webmaster@zope.org
Mon, 30 Sep 2002 09:55:24 -0400


A comment to the paragraph below was recently added via http://www.zope.org/Documentation/Books/ZDG/current/Products.stx#4-29

---------------

        In order to make your poll class work correctly as an 'Item'
        you'll need to make a few changes. You must add a 'meta_type'
        class attribute, and you may wish to add an 'id' parameter to
        the constructor::

          class PollProduct(..., Item):

              meta_type='Poll'
              ...

              def __init__(self, id, question, responses):
                  self.id=id
                  self._question = question
                  self._responses = responses
                  self._votes = {}
                  for i in range(len(responses)):
                      self._votes[i] = 0

          % Anonymous User - Sep. 30, 2002 9:55 am:
           I guess class PollProduct should have a title atrribute!?!