dynamically defined size attribute in a dtml-var tag?
Hi, is it possible to have a dynamically defined size attribute in a dtml-var tag? <dtml-var position size=_.int(_['leng']) etc=""> <dtml-var position size=leng etc=""> zope keeps telling me my size attribute is a string this is in a sql_method than you josh oN
josh on wrote:
<dtml-var position size=_.int(_['leng']) etc="">
Maybe you mean: <dtml-var position size="_.int(_['leng'])" etc=""> So size is treated as a python expression? I could be totally wrong though :( Chris
Chris Withers wrote:
josh on wrote:
<dtml-var position size=_.int(_['leng']) etc="">
Maybe you mean: <dtml-var position size="_.int(_['leng'])" etc="">
So size is treated as a python expression?
I could be totally wrong though :(
Fraid so :-) The python code that implements the size attribute doesn't try to use the aquisition or expression machinery on that attribute. The patch I posted makes it use acquisition if atoi() fails on the value of size. I didn't consider looking at adding evaluating expressions too. That shouldn't be too hard though. -- Steve Alexander Software Engineer Cat-Box limited
josh on wrote:
Hi,
is it possible to have a dynamically defined size attribute in a dtml-var tag?
<dtml-var position size=_.int(_['leng']) etc=""> <dtml-var position size=leng etc="">
zope keeps telling me my size attribute is a string
I answered this on the list just last week (Sunday). Look in the mail archives. It requires a patch to lib/python/DocumentTemplate/DT_Var.py The title of the thread is "non static size parameter in dtml-var". Look in NIP Ltd.'s list archive: http://zope.nipltd.com/public/lists/zope-archive.nsf/ -- Steve Alexander Software Engineer Cat-Box limited
participants (3)
-
Chris Withers -
josh on -
Steve Alexander