#9256: Let the template parser remember it's root nodelist ---------------------------------------------+------------------------------ Reporter: SmileyChris | Owner: SmileyChris Status: assigned | Milestone: Component: Template system | Version: 1.0 Resolution: | Keywords: Stage: Design decision needed | Has_patch: 1 Needs_docs: 0 | Needs_tests: 0 Needs_better_patch: 0 | ---------------------------------------------+------------------------------ Comment (by SmileyChris):
Sure. The problem I was facing is that my tag needed to find a separate node (generated by previously parsed tokens). Currently, the parser creates a root nodelist when starts parsing the tokens (`nodelist = self.create_nodelist()`) but there is no way to access this nodelist because it is only a local variable. By allowing this to be an instance variable it allows tags (which accept the parser instance as one of the arguments) to inspect - and modify if necessary - the nodelist created so far. Specifically, my `{% repeatblock %}` tag was taking on the suggestion of Malcolm regarding allowing a the contents of a block node to be used more than once in an old discussion (which, in certain cases, would still be useful) -- Ticket URL: <http://code.djangoproject.com/ticket/9256#comment:3> 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 django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---