[Zope] Variable substitution of <dtml-in> Attributes

Paul Zwarts paz@oratrix.com
Tue, 6 Nov 2001 10:45:23 +0100


Adam,

Do it in your ZSQL method instead. That way you pass:

<dtml-in "blah(something=something, order='desc', sort='field')">

Then in your sql method:

Select * from blah where foo=<dtml-sqlvar something type=string>
Order by <dtml-var sort> <dtml-var order>


I use is a few times, quite nicely.

Paul Zwarts

-----Original Message-----
From: zope-admin@zope.org [mailto:zope-admin@zope.org] On Behalf Of Adam
Warner
Sent: Tuesday, November 06, 2001 6:30 AM
To: zope@zope.org
Subject: [Zope] Variable substitution of <dtml-in> Attributes

Hi all,

This doesn't appear to be possible but I'm just confirming. I have this
line of code:

<dtml-in expr="PARENTS[0].objectValues('Folder')" sort=id>

I'd like to be able to substitute the Attributes as a string. For
example a dtml method called sort_order may contain the string:

reverse sort=id

Then I would substitute that in at runtime. It might look something like
this:

<dtml-in expr="PARENTS[0].objectValues('Folder')" &dtml-sort_order;>

However this and similar attempts gives me a Document Template Parse
Error.

Thanks,
Adam






_______________________________________________
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 )