16 Nov
2000
16 Nov
'00
9:02 p.m.
zope writes:
I want to test if there is some data in a table. In Zope, ZSQL methods return objects that behave like a sequence (of hit rows).
In Python, an empty sequence is false while a non-empty sequence is true. Thus, you can use: <dtml-if "ZSQLmethod(....)"> .... to test any SQL query for a non-empty result set. The "_.len(...)" function returns the length of a sequence, in case you are interested in the number of hits. Dieter