[Zope] renaming python input params in DTML

Lee lee.reilly@ntlworld.com
Sun, 14 Jan 2001 21:22:34 +0000


Hi,

I am having a problem passing in a variable to a Python method, which is
obtained from the REQUEST object - I'd really appreciate someone's
insight into how to correctly go about this.

I have a form that submits a parameter named '9728430xp0xclasstest' with
a value = 7 to a DTML method.

I have a Python method expecting 'text' as a parameter so I want the
DTML method to send 'text' onto this with a value = the value of the
original parameter appended to name (i.e. 9728430xp0xclasstestx7).

So text=9728430xp0xclasstestx7

Does that make sense?

The Python method, testSQL, returns 'result'. As I recently found out, I
have to make to make use of the REQUEST object to obtain these
parameters.

The following snippet produces the correct value
(9728430xp0xclasstestx7)...

<dtml-in expr="REQUEST.form.items()"><dtml-var sequence-key>x<dtml-var
sequence-item></dtml-in>

... but how can I can pass this as 'text' to my Python method?

Am I on the right track with the following:

<dtml-in expr="REQUEST.form.items()">
<dtml-in expr="testSQL(text='<dtml-var sequence-key>x<dtml-var
sequence-item>')">
<dtml-var result>
</dtml-in></dtml-in>

Thank very much for any help you can offer.

- Best regards,

PS:

<dtml-let text="'9728430xp0xclasstestx7'">
<dtml-var text>
</dtml-let> ... may help

but...

<dtml-var standard_html_header>
<dtml-in expr="REQUEST.form.items()">
   <dtml-let text="'<dtml-var sequence-key>x<dtml-var sequence-item>'">
  <dtml-var text>
 </dtml-let>
</dtml-in> ... gives me text = x !

Any help would really be appreciated?

Thanks :)

--
Lee Reilly
mailto:lee.reilly@ntlworld.com

ø¤º°`°º¤ø,,,,ø¤º°`°º¤ø,,,,ø¤º°`°º¤ø,,,,ø¤º°`°º¤ø,,,,

HAVE SKILLS; WILL TRAVEL.

I'm currently looking for an internship in the USA
in the field of web development. Ideally, I'm looking
for a placement for 3 to 18 months. Can you help?

More details, my resume, etc. @
http://homepages.strath.ac.uk/~aeu97172/

</shameless plug>