[Zope-DB] python script calls zsql method need to compare values
charlie at begeistert.org
Thu Sep 16 12:43:14 EDT 2004
this looks suspiciously like you want to set some HTML colours as a result
of your enquiry. I suggest you simplify things a bit and use a CSS class.
results = context.myZSQL(item=value)
Note that it is generally possible to do this directly in a PageTemplate
without having to call a script.
<body tal:define="status python: context.myZSQL.status or 'error'">
<p tal:attributes="class status" tal:content="status"></p>
On 2004-09-16 at 17:38:41 [+0200], Laura McCord
<Laura.McCord at doucet-austin.com> wrote:
> I am having a problem compraing the value that is returned by a zsql
> This is what I have so far:
> status = context.view_activity(SystemNetName = SystemNetName)
> if status == 'active':
> return '#000'
> if status == 'inactive':
> return '#b7b7b7'
> return status
> Naturally, it is going to return status everytime because status is
> to <Shared.DC.ZRDB.Results.Results instance at 0xb2aa806c>
> So, how to I compare it's actual value?
More information about the Zope-DB