Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jinja2 template path dict in dict #164

Closed
pro-a-v opened this issue Oct 13, 2017 · 4 comments
Closed

jinja2 template path dict in dict #164

pro-a-v opened this issue Oct 13, 2017 · 4 comments

Comments

@pro-a-v
Copy link

pro-a-v commented Oct 13, 2017

Long story short

jinja2 template wrong dict

  • {{ question.question_text }}
  • is a url = app.router[__route_name].url_for(**parts) -> str(URL_PATTERN).format_map(EXPECT_DICT)

    but we have { 'parts' : {RIGHT_DICT} } dict in dict

    Expected behaviour

    Actual behaviour

    Steps to reproduce

    myargs = {'path': {'question_id' : 1 }}
    var_err = str('/pool/{question_id}').format_map(myargs)
    var_ok = str('/pool/{question_id}').format_map(myargs['path'])
    

    /usr/lib/python3.6/site-packages/aiohttp_jinja2/helpers.py

    if 'query_' in parts:
        query = parts.pop('query_')
    
    url = app.router[__route_name].url_for(**parts)
    

    Your environment

    @asvetlov
    Copy link
    Member

    Sorry, but your bug report is totally unclear.

    @pro-a-v
    Copy link
    Author

    pro-a-v commented Oct 13, 2017 via email

    @asvetlov
    Copy link
    Member

    Re-read many times and still cannot figure out the problem.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants