Skip to content
Myr

Merge pull request #579 from alex-morega/fix-doc-views

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fix code example in pluggable views documentation

authored by Kenneth Reitz · committed by Kenneth Reitz · parents 43f4120, 11c7461 · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:docs/views.rst+1 added-1 removed
34 unmodified lines
35 def dispatch_request(self):36 users = User.query.all()37 return render_template('users.html', objects=users)3839 app.add_url_rule('/users/', ShowUsers.as_view('show_users'))39 app.add_url_rule('/users/', view_func=ShowUsers.as_view('show_users'))4041As you can see what you have to do is to create a subclass of42:class:`flask.views.View` and implement43:meth:`~flask.views.View.dispatch_request`. Then we have to convert that
194 unmodified lines