Skip to main content

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


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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flask_classical-0.1.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file flask_classical-0.1.0.tar.gz.

File metadata

  • Download URL: flask_classical-0.1.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/5.15.0-79-generic

File hashes

Hashes for flask_classical-0.1.0.tar.gz
Algorithm Hash digest
SHA256 055d16f216221ccc57818ffa932650afc9efdd58e727997b185f62ab45c90389
MD5 c063a08e6df182db3ce7fd4d4b16e6bc
BLAKE2b-256 bd36cedfb5ee6027a2ef35311da5a7d69343744fa232b5ff6d63984494f90240

See more details on using hashes here.

File details

Details for the file flask_classical-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: flask_classical-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.10.12 Linux/5.15.0-79-generic

File hashes

Hashes for flask_classical-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7499427d1423781b2865065580691173fd18581a0b2fc15f425425d77e2093d
MD5 9afa8c3a68515a5f138b569b8e4a83f7
BLAKE2b-256 2bcd86d7b97e9d2be12b0f1cb4a3c564423eb1c0193989026b5e3ea1b1bfb322

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page