Flask extension for providing class-based views
Project description
Flask-Classical
Flask extension for providing class-based views.
The following views are provided: CreateView, EditView, DeleteView
Installation
$ pip install Flask-Classical
Usage
First create and initialize the cbv
object:
from flask_cbv import Cbv
cbv = Cbv(db, wtf)
# db is your Flask-Alchemist instance
# wtf is your Flask-Formist instance
And then you can add routes, for example:
entries_blueprint.add_url_rule(
"/<int:obj_id>/edit/",
view_func=login_required(
cbv.EditView.as_view(
"edit_entry",
form_cls=EntryForm,
template="entries/edit_entry.html",
obj_cls=Entry,
blueprint="entries",
validators=(current_user_is_author,),
)
),
methods=("GET", "POST"),
)
License
Flask-Classical
was created by Rafal Padkowski. It is licensed under the terms
of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
flask_classical-0.1.0.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for flask_classical-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7499427d1423781b2865065580691173fd18581a0b2fc15f425425d77e2093d |
|
MD5 | 9afa8c3a68515a5f138b569b8e4a83f7 |
|
BLAKE2b-256 | 2bcd86d7b97e9d2be12b0f1cb4a3c564423eb1c0193989026b5e3ea1b1bfb322 |