diff options
| author | Bert JW Regeer <bertjw@regeer.org> | 2016-02-21 16:10:24 -0700 |
|---|---|---|
| committer | Bert JW Regeer <bertjw@regeer.org> | 2016-02-21 16:10:24 -0700 |
| commit | 1c4c2bccdff38c8c7e0fefd26d65a875fd50d8ad (patch) | |
| tree | 0db5dd6f25a9166c118c4a24d66f281f43b0aeba /docs/quick_tour/view_classes | |
| parent | 30ae71b4a7ad97a649165374a75a70f4b64ae25c (diff) | |
| parent | aa6e5fe4f1190e6df123e3f6ccde9deb789eb344 (diff) | |
| download | pyramid-1c4c2bccdff38c8c7e0fefd26d65a875fd50d8ad.tar.gz pyramid-1c4c2bccdff38c8c7e0fefd26d65a875fd50d8ad.tar.bz2 pyramid-1c4c2bccdff38c8c7e0fefd26d65a875fd50d8ad.zip | |
Merge branch 'master' into feature/configurable-view-deriver
Diffstat (limited to 'docs/quick_tour/view_classes')
| -rw-r--r-- | docs/quick_tour/view_classes/app.py | 6 | ||||
| -rw-r--r-- | docs/quick_tour/view_classes/hello.jinja2 | 8 | ||||
| -rw-r--r-- | docs/quick_tour/view_classes/views.py | 2 |
3 files changed, 6 insertions, 10 deletions
diff --git a/docs/quick_tour/view_classes/app.py b/docs/quick_tour/view_classes/app.py index 468c8c29e..40faddd00 100644 --- a/docs/quick_tour/view_classes/app.py +++ b/docs/quick_tour/view_classes/app.py @@ -3,11 +3,11 @@ from pyramid.config import Configurator if __name__ == '__main__': config = Configurator() - # Start Routes 1 config.add_route('hello', '/howdy/{name}') - # End Routes 1 + config.add_route('hello_json', 'hello.json') + config.add_static_view(name='static', path='static') config.include('pyramid_jinja2') config.scan('views') app = config.make_wsgi_app() server = make_server('0.0.0.0', 6543, app) - server.serve_forever()
\ No newline at end of file + server.serve_forever() diff --git a/docs/quick_tour/view_classes/hello.jinja2 b/docs/quick_tour/view_classes/hello.jinja2 index 3446b96ce..fc3058067 100644 --- a/docs/quick_tour/view_classes/hello.jinja2 +++ b/docs/quick_tour/view_classes/hello.jinja2 @@ -5,13 +5,11 @@ </head> <body> <h1>Hello {{ view.name }}!</h1> -<!-- Start Form 1 --> <form method="POST" action="{{ request.current_route_url() }}"> - <input name="new_name"/> - <input type="submit" name="form.edit" value="Save"/> - <input type="submit" name="form.delete" value="Delete"/> + <input name="new_name"> + <input type="submit" name="form.edit" value="Save"> + <input type="submit" name="form.delete" value="Delete"> </form> -<!-- End Form 1 --> </body> </html>
\ No newline at end of file diff --git a/docs/quick_tour/view_classes/views.py b/docs/quick_tour/view_classes/views.py index 62556142e..10ff238c7 100644 --- a/docs/quick_tour/view_classes/views.py +++ b/docs/quick_tour/view_classes/views.py @@ -4,7 +4,6 @@ from pyramid.view import ( ) -# Start View 1 # One route, at /howdy/amy, so don't repeat on each @view_config @view_defaults(route_name='hello') class HelloWorldViews: @@ -29,4 +28,3 @@ class HelloWorldViews: def delete_view(self): print('Deleted') return dict() - # End View 1
\ No newline at end of file |
