mako icon indicating copy to clipboard operation
mako copied to clipboard

Dict can not be passed to a function when using the “custom tag” format

Open sqlalchemy-bot opened this issue 11 years ago • 1 comments

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 }">

sqlalchemy-bot avatar Aug 27 '13 11:08 sqlalchemy-bot

Michael Bayer (@zzzeek) wrote:

a fix is unlikely unless someone has an approach they'd like to try. use dict().

sqlalchemy-bot avatar Aug 27 '13 15:08 sqlalchemy-bot