[Zope] horrible ZCatalog kludge

Kyler Laird Kyler@Lairds.com
Sat, 13 Jul 2002 18:28:51 -0500


O.k., so I want to know how to get a list of all objects
in a ZCatalog for which some variable has a non-null
value.  A star (*) by itself doesn't work, so how to do
it?  Well, here's my kludge...

	catalog = container.people.catalog

	values = []
	for value in catalog.uniqueValuesFor('nominator'):
		if value:
			values.append(value)
	print len(catalog(nominator=values))

I feel so dirty...

--kyler