daklib.database.base

Classes

BaseMethods(**kwargs)

BaseTimestamp(**kwargs)

class daklib.database.base.BaseMethods(**kwargs)[source]
classmethod get(primary_key, session)[source]

This is a support function that allows getting an object by its primary key.

Architecture.get(3[, session])

instead of the more verbose

session.query(Architecture).get(3)

class daklib.database.base.BaseTimestamp(**kwargs)[source]
created = Column(None, DateTime(timezone=True), table=None, nullable=False, server_default=DefaultClause(<sqlalchemy.sql.functions.now at 0x7fc5da03b490; now>, for_update=False))
modified = Column(None, DateTime(timezone=True), table=None, nullable=False, server_default=DefaultClause(<sqlalchemy.sql.functions.now at 0x7fc5da03b890; now>, for_update=False))
modified_trigger = <DDL@140487742962704; '\nCREATE TRIGGER %(table)s_modified BEFORE UPDATE ON %(fullname)s\nFOR EACH ROW EXECUTE PROCEDURE tfunc_set_modified()\n    '>
modified_trigger_function = <DDL@140487742962832; '\nCREATE OR REPLACE FUNCTION tfunc_set_modified() RETURNS trigger\nLANGUAGE plpgsql\nAS $$\n    BEGIN NEW.modified = now(); return NEW; END;\n$$\n    '>