blob: a94409e26a50cc5ccf586b8624acc6ea892cf5ea (
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
<configure xmlns="http://namespaces.repoze.org/bfg">
<include package="repoze.bfg.includes" />
<!-- we want this view to "win" -->
<route
view=".views.route_view"
path="abc"
name="route" />
<!-- .. even though this one has a more specific context -->
<view
view=".views.global_view"
context="repoze.bfg.traversal.DefaultRootFactory"
/>
<view
name="global2"
view=".views.global2_view"
context="repoze.bfg.traversal.DefaultRootFactory"
/>
<route
path="def"
name="route2"
/>
<!-- we want this view to win for route2 even though global view with
context is more specific -->
<view
route_name="route2"
view=".views.route2_view"
/>
<!-- the global view should be found for this route -->
<route
path="ghi"
name="route3"
use_global_views="True"
/>
<!-- the global view should not be found for this route -->
<route
path="jkl"
name="route4"
/>
<!-- the global view should not be found for this route (/global2) -->
<route
path="mno/*traverse"
name="route5"
/>
<!-- the global view should be found for this route (/global2) -->
<route
path="pqr/*traverse"
name="route6"
use_global_views="True"
/>
<route
path="error"
name="route7"
/>
<view
route_name="route7"
view=".views.erroneous_view"
/>
<route
path="error2"
name="route8"
/>
<view
route_name="route8"
view=".views.erroneous_view"
/>
<!-- we want this view to "win" for route7 as exception view -->
<view
view=".views.exception_view"
for="RuntimeError"
/>
<!-- we want this view to "win" for route8 as exception view-->
<view
route_name="route8"
view=".views.exception2_view"
for="RuntimeError"
/>
<route
path="error_sub"
name="route9"
/>
<view
route_name="route9"
view=".views.erroneous_sub_view"
/>
<!-- we want this view to "win" for route9 as exception view... -->
<view
route_name="route9"
view=".views.exception2_view"
for=".views.SuperException"
/>
<!-- ...even if we have more context-specialized view for raised exception -->
<view
view=".views.exception_view"
for=".views.SubException"
/>
</configure>
|