Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pystache_custom
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pystache_custom
Commits
06c5544e
Commit
06c5544e
authored
Oct 30, 2009
by
Chris Wanstrath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
referencing basic view methods from a template works
parent
05a1c575
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
pystache/view.py
+8
-3
No files found.
pystache/view.py
View file @
06c5544e
import
pystach
e
from
pystache
import
Templat
e
import
os.path
class
View
(
object
):
...
...
@@ -35,7 +35,12 @@ class View(object):
def
template_name
(
self
):
return
self
.
__class__
.
__name__
def
get
(
self
,
attr
,
default
):
if
hasattr
(
self
,
attr
):
return
getattr
(
self
,
attr
)()
else
:
return
default
def
render
(
self
):
template
=
self
.
load_template
()
return
pystache
.
render
(
template
,
self
.
context
)
return
Template
(
template
,
self
)
.
render
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment