summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorChris Wanstrath <chris@ozmm.org>2009-10-30 11:16:23 -0700
committerChris Wanstrath <chris@ozmm.org>2009-10-30 11:16:23 -0700
commita1d461055a800a6a12ef8d283623994f876b3253 (patch)
tree3f236fc1cb817b128dd756134da6162af5c8f6c5 /README.md
parenta6dfe036d83f03620c0c4314d1a77a1af05854b0 (diff)
downloadpystache-a1d461055a800a6a12ef8d283623994f876b3253.tar.gz
mention view classes in the readme
Diffstat (limited to 'README.md')
-rw-r--r--README.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/README.md b/README.md
index 477249b..cf2159b 100644
--- a/README.md
+++ b/README.md
@@ -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
-------