'int' object has no attribute 'objectValues'
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@zopyx.com To: maciej.wisniowski@coig.katowice.pl; tonylabarbara@aol.com 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 <maciej.wisniowski@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.
--On 13. März 2007 08:44:52 -0400 tonylabarbara@aol.com wrote:
AJ says I shouldn't call all those objectValues into memory. Okay, what's a way around that? I just need the number ;) TIA,
Use objectIds(). -aj
participants (2)
-
Andreas Jung -
tonylabarbara@aol.com