deseasion.backend.models.mixins module

class deseasion.backend.models.mixins.BaseModelMixin

Bases: object

create()

Persist the current object in the database

delete()

Delete the current object from the database

on_modification()

Callback called when updating the data.

save()

Commit the object to the database

update()

Update the current object

class deseasion.backend.models.mixins.ModelMixin

Bases: BaseModelMixin

CRUD mixin for the models

delete()

Delete the current object from the database

classmethod get_by_id(id) Self

Returns the instance with the given id

id = Column(None, Integer(), table=None, primary_key=True, nullable=False)
class deseasion.backend.models.mixins.TimestampMixin

Bases: ModelMixin

CRUD mixin, extend with created_at and modified_at fields

create()

Persist the object in the database, with a creation and modification date

created_at = Column(None, DateTime(), table=None)
modified_at = Column(None, DateTime(), table=None)
on_modification()

Set the modification time

update_created()
update_modified()