[Zope] Path expression in Python based script

Andreas Jung lists at zopyx.com
Fri Sep 29 03:05:29 EDT 2006



--On 29. September 2006 09:00:16 +0200 Daniel de la Cuesta 
<cues7a at yahoo.es> wrote:

> Hi, I am beginner working with Zope. I like it but I have some doubts:
>
> I have an structure with folders and subfoulders, each folder and
> subfolder has items.
>
> I want to go round this structre with a Python based script, to know the
> number of elements i do the following:
>
> path="animals"
> items=len(context.sections.path.contentValues())
>
>
> When I try to run the script I get an error saying that the variable
> "path" is not present.

'path'? What should that be? Where should this come from? Since you're
using CMF/Plone you might perform a *more efficient* catalog search.
At least don't use contentValues() - except necessary - since it load
*all* objects from the ZODB into memory.

-aj

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20060929/e4f1a0e3/attachment.bin


More information about the Zope mailing list