mako
mako copied to clipboard
Dict can not be passed to a function when using the “custom tag” format
Migrated issue, originally created by Anonymous
A SyntaxError (unexpected EOF) is raised when trying to pass a dict.
<%form:form id="service-form"
action="${request.current_route_url(action='update')}"
buttons="${False}"
data_attrs="${ {'data-form-primary': ''} }">
I am using mako 0.8.1, python 2.7 on OSX 10.8.
A workaround is to use the dict constructor or to declare the dict before passing it
e.g.
<% data_attr={'data-form-primary': ''} %>
<%form:form id="service-form"
action="${request.current_route_url(action='update')}"
buttons="${False}"
data_attrs="${ data_attr }">
Michael Bayer (@zzzeek) wrote:
a fix is unlikely unless someone has an approach they'd like to try. use dict().