[Zope-dev] Re: Unexpected Behaviour iterating over catalog
search...
Jean Jordaan
jean at upfrontsystems.co.za
Mon Mar 8 09:33:19 EST 2004
>> Surely the thing returned by a Catalog search should be immutable?
>
> Nope, it is "lazy"; immutability would require "realizing" it first,
> which would be prohibitively expensive in many cases.
Yes .. thing is, wrapping with list() or tuple() will therefore
also be prohibitive in those cases, so can't be done routinely.
In those cases, what would be better? Something like
for brain in Catalog(some_index=some_value):
# delete the object, and then
brain_to_delete = Catalog(unique_index=brain.unique_prop)
Catalog.uncatalog_object(brain_to_delete.getPath())
.. can't really think why that would work if Chris's original
doesn't, though.
--
Jean Jordaan
http://www.upfrontsystems.co.za
/courses.html <-- Zope/Plone training!
/kursusse.html
More information about the Zope-Dev
mailing list