[Zope] Simple(?) Syntax Question (dtml-in)

2000-08-25 Thread Tim Cook


I want to use the same DTML method for different operations. It
gathers info from properties of DTML Documents and returns a
list. The list is a list of lists.

Each item in the list valid_prj contains a list of two strings,
ie. 

valid_prj = [['abcd','1234'],['efgh','5678']]

I want to only provide the first item of each list in this
SELECT:

...

dtml-in valid_prj
  OPTION value="dtml-var sequence-item"dtml-var
sequence-item/OPTION
/dtml-in
 
...

But darn if I can get the right combination for the correct
syntax to get only that first item of valid_prj. 

Thanks,
-- Tim Cook --
FreePM Project Coordinator http://www.freepm.org
OS Health Care Alliance Supporter http://www.oshca.org

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




[Zope] Simple(?) Syntax Question (dtml-in)

2000-08-25 Thread Spicklemire, Jerry

Tim asked:

I want to only provide the first item of each list in this
SELECT:

You can use Python "slice" syntax, where the first item of a sequence (index
position 0), is indicated like: listname[0]

try:

dtml-in valid_prj
  dtml-call "REQUEST.set('val_prj_seq_item', _['sequence-item'][0])"
  OPTION value="dtml-val_prj_seq_item;"dtml-var
"val_prj_seq_item"/OPTION
/dtml-in
 

___
Zope maillist  -  [EMAIL PROTECTED]
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 )