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

webmaster@zope.org webmaster@zope.org
Fri, 24 Jan 2003 11:26:03 -0500


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

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

      To use this DTML Method, call it on your poll instance. Notice how
      this DTML makes calls to both your poll instance and the
      'getPercentFor' Python script.

        % Anonymous User - Nov. 6, 2001 10:50 am - This does not function anymore.  Zope blocks on the function "get" in the (last-4)-th line

        % 1jerry - Nov. 15, 2001 8:26 pm - The above DTML Method also does not work.  Replace _.get('sequence-index') with _.getitem('sequence-index').

        % 1jerry - Nov. 15, 2001 8:33 pm - Also, for beginners, "call it on your poll instance" means append the poll instance name (p1, if you named it that) and the name of the DTML Method (usepoll, or whatever you named it) to your URL.  I.E. if you placed your poll in your root of your site, use something like http://www.yoursitename.com/p1/usepoll as the address in your browser.

        % groovehunter - Jan. 24, 2003 11:26 am:
         I got the tarball and added the (corrected) script and dtml-method manually. 
         It does not work: KeyError, Value is the index of the vote (0-4 in my case)::
          File /usr/local/Zope-2.5.0-src/lib/python/DocumentTemplate/DT_Util.py, line 159, in eval
             (Object: castVote(index))
             (Info: index)
           File <string>, line 2, in f
           File /usr/local/Zope-2.5.0-src/lib/python/Products/Poll/PollProduct.py, line 88, in castVote
             (Object: Poll)
         KeyError: (see above)