rasenmaeher_api.db.base

The Gino baseclass with db connection wrapping

Module Contents

Classes

ORMBaseModel

Baseclass with common fields

Functions

bind_config()

Set bind from config and return

init_db()

Create schemas and tables, normally one should use migration manager

Attributes

utcnow

db

DBModel

LOGGER

utcnow[source]
db[source]
DBModel: gino.Gino.Model[source]
LOGGER[source]
class ORMBaseModel[source]

Bases: DBModel

Baseclass with common fields

__table_args__[source]
pk[source]
created[source]
updated[source]
deleted[source]
async classmethod by_pk(pkin, allow_deleted=False)[source]

Get by pk

Parameters:
Return type:

Self

async delete()[source]

override delete method to set the deleted timestamp instead of removing the row

Return type:

bool

async bind_config()[source]

Set bind from config and return

Return type:

None

async init_db()[source]

Create schemas and tables, normally one should use migration manager

Return type:

None