commit | author | age
|
0db4a1
|
1 |
from pyramid.view import notfound_view_config, view_config |
CM |
2 |
from pyramid.response import Response |
|
3 |
|
|
4 |
@notfound_view_config(route_name='foo', append_slash=True) |
|
5 |
def foo_notfound(request): # pragma: no cover |
|
6 |
return Response('foo_notfound') |
|
7 |
|
|
8 |
@notfound_view_config(route_name='baz') |
|
9 |
def baz_notfound(request): |
|
10 |
return Response('baz_notfound') |
|
11 |
|
|
12 |
@notfound_view_config(append_slash=True) |
|
13 |
def notfound(request): |
|
14 |
return Response('generic_notfound') |
|
15 |
|
|
16 |
@view_config(route_name='bar') |
|
17 |
def bar(request): |
|
18 |
return Response('OK bar') |
|
19 |
|
|
20 |
@view_config(route_name='foo2') |
|
21 |
def foo2(request): |
|
22 |
return Response('OK foo2') |
|
23 |
|
|
24 |
def includeme(config): |
|
25 |
config.add_route('foo', '/foo') |
|
26 |
config.add_route('foo2', '/foo/') |
|
27 |
config.add_route('bar', '/bar/') |
|
28 |
config.add_route('baz', '/baz') |
dd3cc8
|
29 |
config.scan('tests.pkgs.notfoundview') |
0db4a1
|
30 |
|