cobra_component_models.orm.mixin package

Submodules

cobra_component_models.orm.mixin.annotation_mixin module

Provide a component annotation mixin with the corresponding ORM columns.

class cobra_component_models.orm.mixin.annotation_mixin.AnnotationMixin[source]

Bases: object

Define a component annotation mixin.

identifier

The annotation identifier.

Type

str

namespace_id

The foreign key of the related Identifiers.org namespace.

Type

int

qualifier_id

The foreign key of the related biology qualifier.

Type

int

biology_qualifier = <RelationshipProperty at 0x7ff8bde25748; no key>
biology_qualifier_id = Column(None, Integer(), ForeignKey('biology_qualifiers.id'), table=None, nullable=False)
identifier = Column(None, String(), table=None, nullable=False)
namespace = <RelationshipProperty at 0x7ff8bde25a48; no key>
namespace_id = Column(None, Integer(), ForeignKey('namespaces.id'), table=None, nullable=False)

cobra_component_models.orm.mixin.name_mixin module

Provide a component name mixin with the corresponding ORM columns.

class cobra_component_models.orm.mixin.name_mixin.NameMixin[source]

Bases: object

Define a component name mixin.

name

A common name for a component.

Type

str

namespace_id

The foreign key of the related Identifiers.org namespace.

Type

int

name = Column(None, String(), table=None, nullable=False)
namespace = <RelationshipProperty at 0x7ff8bde256c8; no key>
namespace_id = Column(None, Integer(), ForeignKey('namespaces.id'), table=None, nullable=False)

cobra_component_models.orm.mixin.timestamp_mixin module

Provide a mixin that tracks creation and update timestamps.

class cobra_component_models.orm.mixin.timestamp_mixin.TimestampMixin[source]

Bases: object

Define creation and update time columns to be mixed in with other tables.

created_on

By default this value is populated at instantiation with the time of the moment.

Type

datetime

updated_on

The time is automatically populated whenever the database model is updated.

Type

datetime

created_on = Column(None, DateTime(timezone=True), table=None, nullable=False, default=ColumnDefault(<function timezone_aware_now>))
updated_on = Column(None, DateTime(timezone=True), table=None, onupdate=ColumnDefault(<function timezone_aware_now>))
cobra_component_models.orm.mixin.timestamp_mixin.timezone_aware_now()[source]

Return the date and time in this moment in the universal timezone.

Module contents

Provide SQLAlchemy ORM mixins that define special columns.