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
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
2 matches
Mail list logo