Database Connection¶
We made some monkeypatch for peewee
and playhouse.flask_utils
in order to better support the integration with Flask
.
-
class
flask_datatables.database.
DataTable
(app=None, database=None, model_class=None)[source]¶ Bases:
playhouse.flask_utils.FlaskDB
Server-side processing integration with DataTables.
- Parameters
app (Optional[Flask]) –
flask.Flask
instance to integrate DataTables.database (Optional[DBConfig]) – Database connection configurations.
model_class (Optional[Type[Model]]) –
flask_datatables.model.Model
class to create data models.
-
init_app
(app)[source]¶ Initialise the
DataTables
with theFlask
application.- Parameters
app (Flask) –
flask.Flask
instance to integrate DataTables.- Return type