Hamish Lawson wrote:
>
> I'm using DocumentTemplate from Python (not in Zope) and I want to use
> a custom format 'javascript_quote' that I've written. In my DTML file I
> have:
>
> <dtml-var name="name" fmt="javascript_quote">
>
> and in the Python code I have
>
> def javascript_quote(s):
> ....
>
> template = DocumentTemplate.HTMLFile(
> 'page.dtml',
> {'javascript_quote': javascript_quote}
> )
>
> print template(None, {'data': data})
>
> But it complains that not everything was converted, presumably because
> it is trying to interpret the fmt="javascript_quote" as a C-style
> format. How do I get it to use my function?
>
> Hamish Lawson
>
you should implement a formating function and register it with
special_formats
for examples of both look near the end /DocumentTemplate/DT_Var.py
Kapil
_______________________________________________
Zope maillist - [EMAIL PROTECTED]
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 )