This is using the web app framework, not Django.
The following template code is giving me an TemplateSyntaxError: 'for' statements with five words should end in 'reversed' error when I try to render a dictionary. I don't understand what's causing this error. Could somebody shed some light on it for me?
{% for code, name in charts.items %}
<option value="{{code}}">{{name}}</option>
{% endfor %}
I'm rendering it using the following:
class GenerateChart(basewebview):
def get(self):
values = {"datepicker":True}
values["charts"] = {"p3": "3D Pie Chart", "p": "Segmented Pied Chart"}
self.render_page("generatechart.html", values)
class basewebview(webapp.RequestHandler):
''' Base class for all webapp.RequestHandler type classes '''
def render_page(self, filename, template_values=dict()):
filename = "%s/%s" % (_template_dir, filename)
path = os.path.join(os.path.dirname(__file__), filename)
self.response.out.write(template.render(path, template_values))