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

allow the usage of the limits in the template as tags #4

Closed
zsoldosp opened this issue Oct 4, 2016 · 2 comments · Fixed by #10
Closed

allow the usage of the limits in the template as tags #4

zsoldosp opened this issue Oct 4, 2016 · 2 comments · Fixed by #10

Comments

@zsoldosp
Copy link
Owner

zsoldosp commented Oct 4, 2016

so that template debugging becomes possible. Something along the lines of

{% block foo %}
  {% TimeLimit total=0.1 %}
    {{ block.super }}
  {% EndTimeLimit %}
{% endblock %}
@zsoldosp
Copy link
Owner Author

zsoldosp commented Oct 4, 2016

@zsoldosp
Copy link
Owner Author

zsoldosp commented Oct 4, 2016

We can either create a registry of limits and then convert each of them into a template tag with typed arguments, or we can create a single one which would take the full name of the limit as its first arg and use importlib to load them

import importlib
getattr(importlib.import_module('path.to.module'), 'LimitName')

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

Successfully merging a pull request may close this issue.

2 participants