sqlalchemy / mako

Mako Templates for Python
https://www.makotemplates.org
MIT License
353 stars 60 forks source link

how do you pass a dict as a parameter to <%namespace:def #400

Open zzzeek opened 3 months ago

zzzeek commented 3 months ago

Discussed in https://github.com/sqlalchemy/mako/discussions/396

Originally posted by **jjgalvez** May 5, 2024 How do I pass a dict to a def when it's called from <%namespace:def>. I would expect that calling ```<%namespace:def param="${ {'id':123} }">``` to work, but when I do I get an error saying I am missing a closing ```}``` for reference ```<%call expr="namespace.def(param={'id':123})">``` works as expected.
sqla-tester commented 3 months ago

Jose has proposed a fix for this issue in the main branch:

Update parsetree.py removed "?" from for x in re.compile(r"(\${.+})" … https://gerrit.sqlalchemy.org/c/sqlalchemy/mako/+/5296

zzzeek commented 3 months ago

bug remains open as we have to revert this, see #401