[Zope] Getting at form variables

Shalabh Chaturvedi shalabh@pspl.co.in
Fri, 26 Nov 1999 00:52:33 +0530


I found another way too !

<dtml-in "REQUEST.form.keys()">
  <dtml-let si=sequence-item>
    <dtml-var sequence-item> = <dtml-var expr="REQUEST[si]">
  </dtml-let>
  <br>
</dtml-in>

I don't think variables like sequence-item with a hyphen should be
defined by Zope considering that they cannot be used in expressions
without renaming them.

Shalabh

----- Original Message -----
From: Shalabh Chaturvedi <shalabh@pspl.co.in>
To: zope <Zope@zope.org>
Sent: Friday, November 26, 1999 12:28 AM
Subject: [Zope] Getting at form variables


| I wanted that a url of the form 'http://url?a=b+c&d=e'
| produce a page like:
|
| [----desired-webpage----
| You submitted:
|   a = b c
|   d = e
| ---------------------------]
|
| I have finally found the following way to do it:-
|
| [----dtml-snip------------
|
| You submitted:
|
| <dtml-in "REQUEST.form.keys()">
|   <dtml-var sequence-item> =  <dtml-var
| "REQUEST.form[_['sequence-item']]">
|   <br>
| </dtml-in>
| ---------------------------]
|
| Is there a neater/better way? More generally, given a dictionary
called
| map and a string called key...
|
| <dtml-var map>   prints `{a: 'b c', d: 'e' }`
| <dtml-var key>    prints  `a`
|
| ...is there a way to get at map[key] through DTML ?
| (`b c` in the above example)
|
| <dtml-var map[<dtml-var key>]> doesn't work.
|
|
| Thanks,
| Shalabh
|
|
| _______________________________________________
| 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 )
|