Base
- class lccs_db.models.base.BaseModel(**kwargs)
Abstract class for ORM models.
- save(commit=True)
Save and persists object in database.
- delete()
Delete object from database.
- classmethod filter(**properties)
Filter data set rows following the provided restrictions.
Provides a wrapper of SQLAlchemy session query.
- Parameters:
properties (dict.) – List of properties to filter of.
- classmethod get(**restrictions)
Get one data set from database.
Throws exception NoResultFound when the filter does not match any result.
- Parameters:
properties (dict.) – List of properties to filter of.
- query: t.ClassVar[Query]
A SQLAlchemy query for a model. Equivalent to
db.session.query(Model). Can be customized per-model by overridingquery_class.Warning
The query interface is considered legacy in SQLAlchemy. Prefer using
session.execute(select())instead.