Skip to content
This repository was archived by the owner on Nov 26, 2024. It is now read-only.

Conversation

@rnagle
Copy link

@rnagle rnagle commented Nov 8, 2014

I changed render_all to use a more reliable way of looking up view functions.

Essentially what this does is avoid a KeyError when using named endpoints. For example:

@app.route('/test/', endpoint='some-name')
def test_view():
    ...

Where endpoint differs from the view function name.

This works because app.app.view_functions is a dict with keys that correspond to the endpoint attribute of each of the app's routes.

Versus globals()[module].__dict__ which has keys for view function names only.

Works with every method of adding routes that I could think of.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant