[Zope] Re: CMFBTreeFolder Behavior
Jens Vagelpohl
jens at dataflake.org
Mon Feb 28 11:55:30 EST 2005
On Feb 28, 2005, at 17:15, David Pratt wrote:
> When images come into the uploads folder, I am resizing each into 3
> sizes using PIL and moving this data into an external file type to
> store file on the filesystem and discarding the original file. I have
> this working except images are not processed immediately when they
> come into uploads folder - so I was looking to cronning to see if
> anything is in the uploads folder each 15 or 30 min.
The behavior you see is simple to explain. Your problem is that you are
mutating the list of items as you go through it - always a bad idea.
Try something like this:
ids = list(folder.objectIds()) # This creates a *copy* of all IDs
for id in ids:
ob = folder._getOb(id)
<do stuff with ob>
jens
More information about the Zope
mailing list