diff options
author | Chris Wanstrath <chris@ozmm.org> | 2009-10-30 11:16:23 -0700 |
---|---|---|
committer | Chris Wanstrath <chris@ozmm.org> | 2009-10-30 11:16:23 -0700 |
commit | a1d461055a800a6a12ef8d283623994f876b3253 (patch) | |
tree | 3f236fc1cb817b128dd756134da6162af5c8f6c5 /README.md | |
parent | a6dfe036d83f03620c0c4314d1a77a1af05854b0 (diff) | |
download | pystache-a1d461055a800a6a12ef8d283623994f876b3253.tar.gz |
mention view classes in the readme
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -24,6 +24,21 @@ Use It >>> pystache.render('Hi {{person}}!', {'person': 'Mom'}) 'Hi Mom!' +You can also create dedicated view classes to hold your view logic. + +Here's your simple.py: + import pystache + class Simple(pystache.View): + def thing(self): + return "pizza" + +Then your template, simple.mustache: + Hi {{thing}}! + +Pull it together: + >>> Simple().render() + 'Hi pizza!' + Test It ------- |