Re: Cannot concatenate context list. Bizarre.

2010-05-18 Thread Thomas Allen
And the following ugly loop adds scripts as I hoped simple concatenation would: def render(self, context): for i in range(0, len(self.scripts)): context['scripts'].insert(i, self.scripts[i]) return '' Thomas On May 18, 2:31 pm, Thomas Allen wrote: > I would like to be able to allow any

Cannot concatenate context list. Bizarre.

2010-05-18 Thread Thomas Allen
I would like to be able to allow any template file to add its own JavaScript. Seemed like an easy implementation: class AddScriptNode(Node): def __init__(self, scripts=[]): self.scripts = scripts def render(self, context): context['scripts'] = self.scripts + context['scripts'] ret