
1 INT21H 2013-01-01 21:29:32 +08:00 **locals() |
3 INT21H 2013-01-01 22:13:33 +08:00 self.render("tmp.html", author=author, objects=objects, cat=cat, tags=tags) 以前是不是这样写? 然后你试试 self.render("tmp.html", **locals()) |
4 Niris 2013-01-01 22:27:04 +08:00 |
5 sillyousu 2013-01-01 22:43:06 +08:00 |
6 INT21H 2013-01-01 22:46:41 +08:00 |
7 66web 2013-01-01 22:52:18 +08:00 刚才没留意看,居然把Tornado看成了BT种子,哈哈!! |
8 kernel1983 2013-01-02 15:59:35 +08:00 |
9 davidx 2013-01-03 11:49:50 +08:00 还有一种方法, 定义一个字典叫d, 在view里, 任何需要传到模板里的变量, 都放进d里, 比如d['post'] = from_db_post. 渲染的时候, 用self.render('XXX.html', **d), 就可以了 |
10 kenneth 2013-01-03 14:13:56 +08:00 |