Skip to content

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

Closed

Description

@zzzeek

Discussed in #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} }"></namespace:def> 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})"></%call> works as expected.

Activity

  1. sqla-tester commented on May 13, 2024

    @sqla-tester
    Collaborator

    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

  2. added a commit that references this issue on May 14, 2024
    042a63f
  3. reopened this on May 14, 2024
  4. zzzeek commented on May 14, 2024

    @zzzeek
    MemberAuthor

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

  5. sqla-tester commented on Dec 3, 2024

    @sqla-tester
    Collaborator

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

    Support the direct passing of dictionary literals. https://gerrit.sqlalchemy.org/c/sqlalchemy/mako/+/5558

  6. added a commit that references this issue on Dec 3, 2024
    8606516
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglexer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions