2008/06/25

Never Set template_values Again!

Since Google App Engine uses django's template system, once you call the template rendering method, you have to set a template_values (or context) dict first and send it to the template.render method so that the template may use the variables. If you forgot to set some necessary variable in this dict, you will get errors from template rendering if you use it.

GAEO, now, automatically send the all instance variables of the controller's instance. That means if you write


self.msg = 'abcd'
self.foo = 'bar'


in your action (controller's method), and you can use msg and foo variable without setting the template_values. It's a cool feature, isn't it?

2 Comments:

G-man said...

Good start! It's nice to have so many smart people looking at how to make the best framework out there...

ericsk said...

@g-man
Thanks for your appreciation :-)