#11234: BlockNode unsafely manages context
---------------------------------------------+------------------------------
Reporter: brutimus | Owner: brutimus
Status: assigned | Milestone:
Component: Template system | Version: SVN
Resolution: | Keywords:
Stage: Design decision needed | Has_patch: 1
Needs_docs: 0 | Needs_tests: 1
Needs_better_patch: 0 |
---------------------------------------------+------------------------------
Comment (by SmileyChris):
I think you're misinterpreting what `context.pop()` actually does - it
doesn't pop the most recent element entered (`'block'`), it pops off the
whole context layer it created when `context.push()` was run.
Setting a variable in the context (refering to the documentation link you
provided) doesn't create a new context layer, it just adds to the current
context layer.
So if your really point of concern is that the lifespan of context
attributes created inside of a block tag only have the lifespan of that
block, then that is a different issue (it's not "unsafely managing"
anything at least). And perhaps there should be a public method for adding
to the base context layer - your tags can technically do it already by
adding the "global" variable to `context.dicts[len(context.dicts)-1]`.
--
Ticket URL: <http://code.djangoproject.com/ticket/11234#comment:5>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---