[Zope] Arguments to callbacks?

Dieter Maurer dieter@handshake.de
Tue, 26 Feb 2002 20:37:20 +0100


Jan Johansson writes:
 > I have the below code, which doesnt work as expected. Everythime i execute it, "sortid" seems to be turned into an array with another elemet tacked on every iteration?
 > What i want to do is use URL which performs a callback, and then passes the var "sortid" to the getCSBans method... 
 > 
 > sortid on first attempt is "timestamp"
 > if i then click "wonid" i get ['timestamp', 'wonid'] 
 > 
 > What am i not understanding?
That "sequence-query" is the complete query string with just the
"start" argument removed.
When you append "sortit=..." and there already has been a "sortit"
parameter in the query string, you get two of them and
Zope presents them in a list.

Your options:

  *  You find a patch on

        <http://www.dieter.handshake.de/pyprojects/zope>

     to ZPublisher that lets you specify with a ":last" suffix
     that you just want the last value.

  *  You use "sortit:list", instead of "sortit".
     This has the advantage that you always get a list (or nothing at all).
     You are interested in the last element: "sortit[-1]".

  *  ....


Dieter