Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pyx/flask-diced
Flask-Diced - CRUD views generator for Flask
https://github.com/pyx/flask-diced
flask flask-extensions
Last synced: 2 months ago
JSON representation
Flask-Diced - CRUD views generator for Flask
- Host: GitHub
- URL: https://github.com/pyx/flask-diced
- Owner: pyx
- License: other
- Created: 2016-03-23T18:05:17.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-04-28T17:39:11.000Z (over 8 years ago)
- Last Synced: 2024-10-01T10:23:20.068Z (3 months ago)
- Topics: flask, flask-extensions
- Language: Python
- Homepage:
- Size: 27.3 KB
- Stars: 16
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
============================================
Flask-Diced - CRUD views generator for Flask
============================================Flask-Diced is a set of helper classes for `Flask`_ that generates CRUD views
and registers them to blueprint/application.Flask-Diced provides:
- **D**\ etail view
- **I**\ ndex view
- **C**\ reate view
- **E**\ dit view
- **D**\ elete view.. _Flask: http://flask.pocoo.org/
Flask-Diced Might Not Be What You Want
======================================Flask-Diced is opinionated, it assumes:
- the model object has a :code:`save` method for data persistence and
:code:`delete` method to remove itself.
- the model can be created with no required arguments.
- the form used for creation and editing are in the style of `Flask-WTF`_'s,
specifically, Flask-Diced expects the form accepts a named parameter
:code:`obj` to pass in the initial value for editing as well as
:code:`validate_on_submit` method and :code:`populate_obj` method on the form
class. In short, just use `Flask-WTF`.
- the client should be redirected when done for POST requests.
- views should have minimal business logic... _Flask-WTF: https://pypi.python.org/pypi/Flask-WTF
Flask-Diced is Extensible
=========================Flask-Diced is designed in a way that customizations can be easily done. All
properties and methods can be overridden for customization.Flask-Diced can be customized to the point that the assumptions described in
last section are refer to the default implementation and will no longer hold
true if you customize relevant parts of it.e.g.,
*Want to change how the objects list is fetched?*
Override :code:`query_all`
*Want to change the name of endpoint of the edit view?*
Redefine :code:`edit_endpoint`
*Want to use your own view function or control how views are registered?*
Override respective view/register methods.
Installation
============Flask-Diced is on PyPI.
.. code-block:: sh
pip install Flask-Diced
License
=======BSD New, see LICENSE for details.
Links
=====- `Documentation `_
- `Issue Tracker `_
- `Source Package @ PyPI `_
- `Mercurial Repository @ bitbucket
`_- `Git Repository @ Github
`_- `Git Repository @ Gitlab
`_- `Development Version
`_