When I rewrite the command to tal:replace "batch" and surf to it, it displays 
the object values of every object in the quotes folder. That's what inspired me 
to measure the len. So, "batch" is not a number, but "num" is, and I've proven 
this by having the scriptlet print out that number. 
AJ says I shouldn't call all those objectValues into memory. Okay, what's a way 
around that? I just need the number ;)

-----Original Message-----
Cc: zope@zope.org
Sent: Tue, 13 Mar 2007 1:50 AM
Subject: Re: [Zope] 'int' object has no attribute 'objectValues'

--On 12. März 2007 23:25:59 +0100 Maciej Wisniowski <[EMAIL PROTECTED]> wrote: 
>> <span tal:define="batch here/quotes/objectValues; num python:len(batch)"> 
>> <p tal:replace="python:here.randomNumber(num)" /> 
>> </span> 
> Check what here/quotes is evaluating to. Seems that it is int. 
In addition there is no need to call objectValues just to determine the 
number of all objects within a container. objectValues() will load 
*all objects* of the folder *into memory*. Don't do that. 
AOL now offers free email to everyone.  Find out more about what's free from 
AOL at AOL.com.
Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to