Harpal
Harpal

Reputation: 839

Python: KeyError with form.getfirst

I have a dtml page, which calls a function, with this code:

<dtml-var public_blast(form.getfirst('job_ID'))>

But i get a key error? stating KeyError: "public_blast(form.getfirst('job_ID'))". I can see the job_ID variable at the top of the page. So i know it is being passed to the URL.

I cant see where im going wrong?

Upvotes: 0

Views: 659

Answers (2)

tomvon
tomvon

Reputation: 5371

Try <dtml-var "REQUEST['job_ID']">

Upvotes: 0

Daniel Roseman
Daniel Roseman

Reputation: 599628

It's been a very long time since I did any DTML, but I don't think you can call Python functions directly like that inside a DTML tag.

Instead I think you need to use the expr attribute:

<dtml-var expr="public_blast(form.getfirst('job_ID'))">

Upvotes: 0

Related Questions