Skip to content

Commit eb6549d

Browse files
committed
Merge pull request pallets#262 from SimonSapin/patch-1
Typo fix in code samples for Pluggable Views doc.
2 parents 284025f + 0ff7fe2 commit eb6549d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/views.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ For instance you can write a class like this::
8686

8787
And then you can register it like this::
8888

89-
app.add_url_view('/about', RenderTemplateView.as_view(
89+
app.add_url_rule('/about', view_func=RenderTemplateView.as_view(
9090
'about_page', template_name='about.html'))
9191

9292
Method Hints
@@ -108,7 +108,7 @@ information::
108108
...
109109
...
110110

111-
app.add_url_view('/myview', MyView.as_view('myview'))
111+
app.add_url_rule('/myview', view_func=MyView.as_view('myview'))
112112

113113
Method Based Dispatching
114114
------------------------
@@ -130,7 +130,7 @@ easily do that. Each HTTP method maps to a function with the same name
130130
user = User.from_form_data(request.form)
131131
...
132132

133-
app.add_url_view('/users/', UserAPI.as_view('users'))
133+
app.add_url_rule('/users/', view_func=UserAPI.as_view('users'))
134134

135135
That way you also don't have to provide the
136136
:attr:`~flask.views.View.methods` attribute. It's automatically set based

0 commit comments

Comments
 (0)