[Zope-DB] Re: python script calls zsql method need to compare values
Michael Haubenwallner
michael at d2m.at
Thu Sep 16 11:52:59 EDT 2004
Laura McCord wrote:
> Hi,
>
> I am having a problem compraing the value that is returned by a zsql
> method.
> This is what I have so far:
>
> status = context.view_activity(SystemNetName = SystemNetName)
> if status == 'active':
> return '#000'
> if status == 'inactive':
> return '#b7b7b7'
> else:
> return status
>
> Naturally, it is going to return status everytime because status is
> equal
> to <Shared.DC.ZRDB.Results.Results instance at 0xb2aa806c>
>
> So, how to I compare it's actual value?
>
Hio Laura,
ZSQLMethods return a sequence of result objects.
Read more about how to access them at
http://www.plope.com/Books/2_7Edition/RelationalDatabases.stx#2-74
Michael
More information about the Zope-DB
mailing list