Matthew White wrote:
oops!  I thought I'd clean up my code snippet to make it a little more
readable, and instead introduced an error.  Here it is in full:

        <tal:loop repeat="t python:test(exists('/request/form/view_all'),
                                        container.py.new_get_queue(whence=q),
                                        container.py.new_get_queue(whence=q, 
userid=userid))">

As another thing here, the above is pretty expensive, since you call new_get_queue twice, whatever happens, how about the following:

<tal:loop repeat="t python:container.py.new_get_queue(
                       whence=q,
                       userid=request.form.get('view_all') and \
                              userid or None))">

..and then make new_get_queue do the right thing when it gets None as userid.

I'd probably also change the following to be a metal: macro include rather than calling the second template.

                                                                        
                <span tal:replace="structure here/queue_template">
                        Queue Template Goes Here
                </span>

As a general comment, you're trying to do too much logic in ZPT here, do much more work in a class or python script and just return the stuff you want to display to the ZPT...

cheers,

Chris

--
Simplistix - Content Management, Zope & Python Consulting
           - http://www.simplistix.co.uk

_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to