[Zope] dynamically call zsqlmethod

Andreas Jung lists at zopyx.com
Wed Nov 25 13:56:44 EST 2009


getattr(context, column)()?

-aj

On Wed, Nov 25, 2009 at 19:53, Garry Saddington
<garry at schoolteachers.co.uk>wrote:

> I am passing a variable named 'column' to the following script and
> trying to fill a select box with the result of a zsqlmethod chosen
> dynamically using this variable.
>
> print """<select name="nonboolean" method="post">"""
> command=context.column()
>
> for row in command:
>     code=row.code
>     meaning=row.meaning
>     print """<option value="%s">%s</option>""" &(code,meaning)
>
> print """</select>"""
> return printed
>
>
>
> I can not work out how to substitiute the command with the variable, any
> help much appreciated.
> Regards
> Garry
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> https://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  https://mail.zope.org/mailman/listinfo/zope-announce
>  https://mail.zope.org/mailman/listinfo/zope-dev )
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20091125/8a182c71/attachment.html 


More information about the Zope mailing list