Skip to content
Myr

fix view docs

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

authored by David Lord · committed by David Lord · parent 1d07857 · Browse files · 1 file+8 added−3 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+8 added−3 removed

  • other:+8 added−3 removed

1 file+8 added−3 removed

modified:docs/views.rst+8 added-3 removed
114 unmodified lines
115 def dispatch_request(self, id)116 item = self.model.query.get_or_404(id)117 return render_template(self.template, item=item)118119 app.add_url_rule("/users/<int:id>", view_func=DetailView.as_view("user_detail"))119 app.add_url_rule(120 "/users/<int:id>",121 view_func=DetailView.as_view("user_detail", User)122 )123124125View Lifetime and ``self``126--------------------------
170 unmodified lines
297 db.session.commit()298 return jsonify(item.to_json())299300 def register_api(app, model, url):301 item = ItemAPI.as_view(f"{name}-item", model)302 group = GroupAPI.as_view(f"{name}-group", model)298 app.add_url_rule(f"/{name}/<int:id>", view_func=ItemAPI(f"{name}-item", model))299 app.add_url_rule(f"/{name}/", view_func=GroupAPI(f"{name}-group", model))303 app.add_url_rule(f"/{name}/<int:id>", view_func=item)304 app.add_url_rule(f"/{name}/", view_func=group)305306 register_api(app, User, "users")307 register_api(app, Story, "stories")308
16 unmodified lines