summaryrefslogtreecommitdiff
path: root/examples/inverted.py
blob: e0f7aaffd1e117fe304ffe7ed3343f9632b820be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import pystache

class Inverted(pystache.View):
    template_path = 'examples'

    def t(self):
        return True

    def f(self):
        return False

    def two(self):
        return 'two'

    def empty_list(self):
        return []
        
    def populated_list(self):
        return ['some_value']

class InvertedLists(Inverted):
    template_name = 'inverted'

    def t(self):
        return [0, 1, 2]

    def f(self):
        return []