From 2fd9aaf17c5cc06619145a8c495d6e9ac6fed563 Mon Sep 17 00:00:00 2001 From: Mellcap Date: Tue, 10 Jan 2017 15:59:31 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20doc=20=E2=80=9CClass=20based=20views?= =?UTF-8?q?=E2=80=9D.=20-=20Remove=20the=20as=5Fview=20method.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/class_based_views.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/class_based_views.md b/docs/class_based_views.md index 84a5b952..48bb1915 100644 --- a/docs/class_based_views.md +++ b/docs/class_based_views.md @@ -28,7 +28,7 @@ class SimpleView(HTTPMethodView): def delete(self, request): return text('I am delete method') -app.add_route(SimpleView.as_view(), '/') +app.add_route(SimpleView(), '/') ``` @@ -40,7 +40,7 @@ class NameView(HTTPMethodView): def get(self, request, name): return text('Hello {}'.format(name)) -app.add_route(NameView.as_view(), '/') +app.add_route(NameView(), '/') ``` @@ -53,6 +53,6 @@ class ViewWithDecorator(HTTPMethodView): def get(self, request, name): return text('Hello I have a decorator') -app.add_route(ViewWithDecorator.as_view(), '/url') +app.add_route(ViewWithDecorator(), '/url') ```