django-templates-macros
django-templates-macros copied to clipboard
setmacro is broken by design
When using usemacro, the context is updated with variables passed to the macro
A context variable with the name of the macro is created containing the result of the macro.
But setmacro do the same!!
So each call of usemacro or setmacro for the same macro will erase the previous context variable.
TODO:
- [ ] make a copy of the context before updating it to pass it to the macro
- [ ] stop saving the result of the macro in the context
- [ ] make
usemacroaccept aasargument (as some django template tags), and removesetmacro
PS: it was removed from the documentation in 0.3 (but still available in code)