RE: [Zope] conditional dtml-in ?
If I do <dtml-if expr="my_attribute == 1"> <dtml-in> </dtml-in> </dtml-if> my_attribute isn't an attribute of each sequence_item If I do <dtml-in> <dtml-if> </dtml-if> </dtml-in> I cannot use the dtml-in modifiers, like start="1", size="10">... I mean, I can use them but I'd like them to mean "start from position 1 of the sequence of the items matching the where-like clause" and "take the first 10 elements of the sequence of the items matching the where-like clause". Am I wrong? Michele
-----Original Message----- From: Garry Steedman [mailto:gs@styrax.com] Sent: mercoledì 7 novembre 2001 18.28 To: Ruberl Michele Cc: zope@zope.org Subject: Re: [Zope] conditional dtml-in ?
Michele,
am i missing something, why dont you do
<dtml-if> <dtml-in> </dtml-in> </dtml-if>
or some combination thereof???
cheers,
garry
On 7 Nov 2001, at 17:18, Ruberl Michele wrote:
From: Ruberl Michele <mruberl@etnoteam.it> To: "'zope@zope.org'" <zope@zope.org> Subject: [Zope] conditional dtml-in ? Date sent: Wed, 7 Nov 2001 17:18:03 +0100
Hi everybody,
is there a way of making <dtml-in> loops conditionally?
I would need something like <dtml-in expr="objectValues('MyZClass')" where="my_attribute == 1"> Does anybody have a method doing this or a way to help me?
Thanks a lot
Michele
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
+-------------------------------------------+ Garry Steedman mailto:gs@styrax.com Styrax Associates http://www.styrax.com/
"The Good Man has no shape." +-------------------------------------------+
I suggest that you use one dtml-in loop to build up a list that contains only the elements that you want, then do a dtml-in loop on that array. Cheers, Tom P [Ruberl Michele] If I do <dtml-if expr="my_attribute == 1"> <dtml-in> </dtml-in> </dtml-if> my_attribute isn't an attribute of each sequence_item If I do <dtml-in> <dtml-if> </dtml-if> </dtml-in> I cannot use the dtml-in modifiers, like start="1", size="10">... I mean, I can use them but I'd like them to mean "start from position 1 of the sequence of the items matching the where-like clause" and "take the first 10 elements of the sequence of the items matching the where-like clause". Am I wrong? Michele
-----Original Message----- From: Garry Steedman [mailto:gs@styrax.com] Sent: mercoledì 7 novembre 2001 18.28 To: Ruberl Michele Cc: zope@zope.org Subject: Re: [Zope] conditional dtml-in ?
Michele,
am i missing something, why dont you do
<dtml-if> <dtml-in> </dtml-in> </dtml-if>
or some combination thereof???
cheers,
garry
On 7 Nov 2001, at 17:18, Ruberl Michele wrote:
From: Ruberl Michele <mruberl@etnoteam.it> To: "'zope@zope.org'" <zope@zope.org> Subject: [Zope] conditional dtml-in ? Date sent: Wed, 7 Nov 2001 17:18:03 +0100
Hi everybody,
is there a way of making <dtml-in> loops conditionally?
I would need something like <dtml-in expr="objectValues('MyZClass')" where="my_attribute == 1"> Does anybody have a method doing this or a way to help me?
I suggest that you use one dtml-in loop to build up a list that contains only the elements that you want, then do a dtml-in loop on that array.
I suggest using a python script to build the list and the <dtml-in over the results of the python script. Much cleaner IMHO
Michele, you probably want to do something like this then (not that i'm saying DTML is the best way to do it... ;-): <dtml-call "REQUEST.set('results', [])"> <dtml-in "objectValues('Folder')"> <dtml-if "hasProperty('invisible') and invisible"> <dtml-call "results.append(_.getitem('sequence-item'))"> </dtml-if> </dtml-in> <dtml-in results> <li><dtml-var title> </dtml-in> cheers, Garry On 7 Nov 2001, at 17:32, Ruberl Michele wrote: From: Ruberl Michele <mruberl@etnoteam.it> To: gs@styrax.com, zope@zope.org Subject: RE: [Zope] conditional dtml-in ? Date sent: Wed, 7 Nov 2001 17:32:23 +0100
If I do
<dtml-if expr="my_attribute == 1"> <dtml-in> </dtml-in> </dtml-if>
my_attribute isn't an attribute of each sequence_item
If I do
<dtml-in> <dtml-if> </dtml-if> </dtml-in>
I cannot use the dtml-in modifiers, like start="1", size="10">... I mean, I can use them but I'd like them to mean "start from position 1 of the sequence of the items matching the where-like clause" and "take the first 10 elements of the sequence of the items matching the where-like clause". Am I wrong?
Michele
-----Original Message----- From: Garry Steedman [mailto:gs@styrax.com] Sent: mercoledì 7 novembre 2001 18.28 To: Ruberl Michele Cc: zope@zope.org Subject: Re: [Zope] conditional dtml-in ?
Michele,
am i missing something, why dont you do
<dtml-if> <dtml-in> </dtml-in> </dtml-if>
or some combination thereof???
cheers,
garry
On 7 Nov 2001, at 17:18, Ruberl Michele wrote:
From: Ruberl Michele <mruberl@etnoteam.it> To: "'zope@zope.org'" <zope@zope.org> Subject: [Zope] conditional dtml-in ? Date sent: Wed, 7 Nov 2001 17:18:03 +0100
Hi everybody,
is there a way of making <dtml-in> loops conditionally?
I would need something like <dtml-in expr="objectValues('MyZClass')" where="my_attribute == 1"> Does anybody have a method doing this or a way to help me?
Thanks a lot
Michele
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
+-------------------------------------------+ Garry Steedman mailto:gs@styrax.com Styrax Associates http://www.styrax.com/
"The Good Man has no shape." +-------------------------------------------+
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
+-------------------------------------------+ Garry Steedman mailto:gs@styrax.com Styrax Associates http://www.styrax.com/ "The Good Man has no shape." +-------------------------------------------+
participants (4)
-
Garry Steedman -
Ruberl Michele -
Steve Drees -
Thomas B. Passin