mirror of https://github.com/pallets/flask.git
Typo fix in code samples for Pluggable Views doc.
This commit is contained in:
parent
62e7f5cea6
commit
0ff7fe2a37
|
|
@ -86,7 +86,7 @@ For instance you can write a class like this::
|
||||||
|
|
||||||
And then you can register it like this::
|
And then you can register it like this::
|
||||||
|
|
||||||
app.add_url_view('/about', RenderTemplateView.as_view(
|
app.add_url_rule('/about', view_func=RenderTemplateView.as_view(
|
||||||
'about_page', template_name='about.html'))
|
'about_page', template_name='about.html'))
|
||||||
|
|
||||||
Method Hints
|
Method Hints
|
||||||
|
|
@ -108,7 +108,7 @@ information::
|
||||||
...
|
...
|
||||||
...
|
...
|
||||||
|
|
||||||
app.add_url_view('/myview', MyView.as_view('myview'))
|
app.add_url_rule('/myview', view_func=MyView.as_view('myview'))
|
||||||
|
|
||||||
Method Based Dispatching
|
Method Based Dispatching
|
||||||
------------------------
|
------------------------
|
||||||
|
|
@ -130,7 +130,7 @@ easily do that. Each HTTP method maps to a function with the same name
|
||||||
user = User.from_form_data(request.form)
|
user = User.from_form_data(request.form)
|
||||||
...
|
...
|
||||||
|
|
||||||
app.add_url_view('/users/', UserAPI.as_view('users'))
|
app.add_url_rule('/users/', view_func=UserAPI.as_view('users'))
|
||||||
|
|
||||||
That way you also don't have to provide the
|
That way you also don't have to provide the
|
||||||
:attr:`~flask.views.View.methods` attribute. It's automatically set based
|
:attr:`~flask.views.View.methods` attribute. It's automatically set based
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue