Michael Merickel
2018-10-15 2b024920847481592b1a13d4006d2a9fa8881d72
commit | author | age
197f0c 1 from pyramid.view import view_config
aa2fe1 2 from pyramid.renderers import null_renderer
e46105 3
aa2fe1 4 @view_config(name='another', renderer=null_renderer)
e46105 5 def grokked(context, request):
CM 6     return 'another_grokked'
7
aa2fe1 8 @view_config(request_method='POST', name='another', renderer=null_renderer)
e46105 9 def grokked_post(context, request):
CM 10     return 'another_grokked_post'
2cce43 11
aa2fe1 12 @view_config(name='another_stacked2', renderer=null_renderer)
CM 13 @view_config(name='another_stacked1', renderer=null_renderer)
2cce43 14 def stacked(context, request):
CM 15     return 'another_stacked'
16
17 class stacked_class(object):
18     def __init__(self, context, request):
19         self.context = context
20         self.request = request
21
22     def __call__(self):
23         return 'another_stacked_class'
24
aa2fe1 25 stacked_class = view_config(name='another_stacked_class1',
CM 26                             renderer=null_renderer)(stacked_class)
27 stacked_class = view_config(name='another_stacked_class2',
28                             renderer=null_renderer)(stacked_class)
2cce43 29
e46105 30 class oldstyle_grokked_class:
CM 31     def __init__(self, context, request):
32         self.context = context
33         self.request = request
34
35     def __call__(self):
36         return 'another_oldstyle_grokked_class'
37     
aa2fe1 38 oldstyle_grokked_class = view_config(name='another_oldstyle_grokked_class',
CM 39                                      renderer=null_renderer)(
e46105 40     oldstyle_grokked_class)
CM 41
42 class grokked_class(object):
43     def __init__(self, context, request):
44         self.context = context
45         self.request = request
46
47     def __call__(self):
48         return 'another_grokked_class'
49         
aa2fe1 50 grokked_class = view_config(name='another_grokked_class',
CM 51                             renderer=null_renderer)(grokked_class)
e46105 52
022873 53 class Foo(object):
CM 54     def __call__(self, context, request):
55         return 'another_grokked_instance'
56
57 grokked_instance = Foo()
aa2fe1 58 grokked_instance = view_config(name='another_grokked_instance',
CM 59                                renderer=null_renderer)(
197f0c 60     grokked_instance)
022873 61
e46105 62 # ungrokkable
CM 63
64 A = 1
65 B = {}
66
67 def stuff():
68     """ """
69