src.utils_flask_sqla.generic
Module Contents
Classes
Classe permettant de créer à la volée un mapping |
|
Classe permettant de manipuler des objets GenericTable |
Functions
|
Test the type of a filter |
|
Generate a query with the filter given, checking the params is the good type of the columns, and formmatting it |
|
|
|
|
|
Attributes
- src.utils_flask_sqla.generic.testDataType(value, sqlType, paramName)[source]
Test the type of a filter #TODO: antipatern: should raise something which can be exect by the function which use it # and not return the error
- src.utils_flask_sqla.generic.test_type_and_generate_query(param_name, value, model, q)[source]
Generate a query with the filter given, checking the params is the good type of the columns, and formmatting it Params:
param_name (str): the name of the column
value (any): the value of the filter
model (SQLA model)
q (SQLA Query)
- class src.utils_flask_sqla.generic.GenericTable(tableName, schemaName, engine)[source]
- Classe permettant de créer à la volée un mapping
d’une vue avec la base de données par rétroingénierie
- class src.utils_flask_sqla.generic.GenericQuery(DB, tableName, schemaName, filters=[], limit=100, offset=0)[source]
Classe permettant de manipuler des objets GenericTable
- params:
DB: sqlalchemy instantce (DB if DB = Sqlalchemy())
tableName
schemaName
filters: array of filter of the query
- enginesqlalchemy instance engine
for exemple : DB.engine if DB = Sqlalchemy()
limit
offset