[Zope] 'int' object has no attribute 'objectValues'

tonylabarbara at aol.com tonylabarbara at aol.com
Tue Mar 13 08:44:52 EDT 2007


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 ;)
TIA,
Tony 
 

-----Original Message-----
From: lists at zopyx.com
To: maciej.wisniowski at coig.katowice.pl; tonylabarbara at aol.com
Cc: zope at 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 <maciej.wisniowski at coig.katowice.pl> 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. 
 
-aj 
________________________________________________________________________
AOL now offers free email to everyone.  Find out more about what's free from AOL at AOL.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20070313/e9561b3b/attachment-0001.htm


More information about the Zope mailing list