[Zope] dtml-in --> sequence

Andrew Williams ajwms@hotmail.com
Fri, 6 Apr 2001 10:59:08 -0400


----- Original Message -----
From: "After Dark" <afterz@zipmail.com>
To: <zope@zope.org>
Sent: Friday, April 06, 2001 10:42 AM
Subject: [Zope] dtml-in --> sequence


>
> Hi, I`m trying to delete some objects(folders/files), but
> I`m having some problems with sequence-...

Remember, when you put an argument in quotes like <dtml-if expr="myvar ==
'1'">, the stuff in quotes is a python expression.
So, in python, "sequence-item" is actually trying to subtract item from
sequence.

Whenever you are dealing with sequence-item, sequence-key,
sequence-whatever, in a python expression, you need to do this:
_['sequence-item'] _['sequence-key'] and so on...

>
> I`m trying to use manage_delObjects()... I made a list of
> sequence-item with a <dtml-in "Folder.objectValues()">, can
> I pass this list like an argument to manage_delObjects?
> Like <dtml-call "manage_delObjects(list)">

Considering the above, you could right it like this (untested):
<dtml-in "Folder.objectValues()">
  <dtml-call "manage_delObjects(_['sequence-item'])">
</dtml-in>

>
> I think I a little confused with <sequence-..>, when I make

Don't feel bad, you aren't the only one.

> a list like that (objectValues of a folder), do I have the
> object in <sequence-item>? If I make sequence-var-title, is
> it going to return the title? --> Because it`s giving error.
> Or I just have the id and I have to make
> _.getitem(sequence-item).title?
>

yes, when you use <dtml-in> to loop over objects, sequence-item is the
actual object ie (untested):

<dtml-in "Folder.objectValues()">
  <P>Object ID = <dtml-var expr="_['sequence-item'].id"></P>
</dtml-in>



Hope this helps...

Andrew Williams