Zope tag nesting madness!

noahspurrier at my-deja.com noahspurrier at my-deja.com
Mon Oct 9 03:46:26 EDT 2000


Hello,

How do I nest <dtml-var> tags inside of <dtml-in> tags?

In general I want to pass an <dtml-var> to a ZSQL Method,
but <dtml-var> must be an INTEGER. This syntax will not work:
    <dtml-in "show_article(article_id=<dtml-var id>)">
The manager editor will compain about this and will not even let me
submit this change. I get this error:
    invalid syntax
    , for tag <dtml-in "show_article(article_id=<dtml-var id>)">,

The problem here is that I have to pass id as an INTEGER. The editor
will accept this syntax:
    <dtml-in "show_article(article_id='<dtml-var id>')">
but article_id is NOT a string, so the database complains if
I try to run it with this syntax. Essentially it seems like I can
only do this if I want to pass my parameters as strings.
How do I pass integers?

Here is one way, but this only works if I'm calling my
DTML Method from a form then this syntax works:
    <dtml-in "show_article(article_id=REQUEST['id'])">

But I would rather figure out how to do this in the general case.
Do I always have the REQUEST dictionary? Can I add a value to it
just to hack my way out of this syntax problem?

Any advice would be appreciated,

Noah Spurrier


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list