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
(*, is_deprecated: bool = False, **kwargs)[source]¶ Bases:
object
Define a component annotation mixin.
-
identifier
¶ The annotation identifier.
- Type
str
-
is_deprecated
¶ Whether the identifier is a deprecated one. Deprecated identifiers are still useful for identifying components from old data.
- Type
bool, optional
-
namespace_id
¶ The foreign key of the related Identifiers.org namespace.
- Type
int
-
biology_qualifier_id
¶ The foreign key of the related biology qualifier.
- Type
int
-
__init__
(*, is_deprecated: bool = False, **kwargs) → None[source]¶ Create an instance with a default value.
-
biology_qualifier
= <RelationshipProperty at 0x7f700e9df548; no key>¶
-
biology_qualifier_id
= Column(None, Integer(), ForeignKey('biology_qualifiers.id'), table=None, nullable=False)
-
identifier
: str = Column(None, String(), table=None, nullable=False)
-
is_deprecated
: bool = Column(None, Boolean(), table=None, nullable=False, default=ColumnDefault(False))
-
namespace
= <RelationshipProperty at 0x7f700e9df848; 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
(*, is_preferred: bool = False, **kwargs)[source]¶ Bases:
object
Define a component name mixin.
-
name
¶ A common name for a component.
- Type
str
-
is_preferred
¶ Mark a component’s name as being preferred.
- Type
bool, optional
-
namespace_id
¶ The foreign key of the related Identifiers.org namespace.
- Type
int
-
__init__
(*, is_preferred: bool = False, **kwargs) → None[source]¶ Create an instance with a default value.
-
is_preferred
: bool = Column(None, Boolean(), table=None, nullable=False, default=ColumnDefault(False))
-
name
: str = Column(None, String(), table=None, nullable=False)
-
namespace
= <RelationshipProperty at 0x7f700e9df7c8; no key>¶
-
namespace_id
= Column(None, Integer(), ForeignKey('namespaces.id'), table=None)
-
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
: datetime.datetime = Column(None, DateTime(timezone=True), table=None, nullable=False, default=ColumnDefault(<function timezone_aware_now>))
-
updated_on
: datetime.datetime = Column(None, DateTime(timezone=True), table=None, onupdate=ColumnDefault(<function timezone_aware_now>))
-
Module contents¶
Provide SQLAlchemy ORM mixins that define special columns.