kepler.models.unit module¶
The module defines the classes for database models related to units. The units are the model for reservable things in the system.
-
class
kepler.models.unit.
Unit
(name_tr_id, max_user_group_size, description_tr_id=None)¶ Bases:
sqlalchemy.ext.declarative.api.Base
The SQLAlchemy declarative model class for a
Unit
object holds information about the units that can be reserved by the users.-
description_tr_id
¶ The translation ID of the description of the unit.
-
id
¶ The ID of the unit.
-
max_user_group_size
¶ The upper limit for the user group size that can make a reservation for the unit.
-
name_tr_id
¶ The translation ID of the name of the unit.
-
-
class
kepler.models.unit.
UnitGroup
(name_tr_id, unit_type_id)¶ Bases:
sqlalchemy.ext.declarative.api.Base
The SQLAlchemy declarative model class for a
UnitGroup
object holds information about the groups the units can belong to.-
active
¶ Specifies whether the unit group is active or has been deactivated.
-
id
¶ The ID of the unit group.
-
name_tr_id
¶ The translation ID of the name of the unit group.
-
unit_type_id
¶ The unit type of the unit group.
-
-
class
kepler.models.unit.
UnitGroupMap
(unit_id, unit_group_id, qualifier)¶ Bases:
sqlalchemy.ext.declarative.api.Base
The class defines the many-to-many mapping for
Units
andUnitGroups
. The mapping may also include an optional qualifier for the mapping.-
qualifier
¶ The optional (i.e. may be null) qualifier for the mapping.
-
unit_group_id
¶ The reference to the
UnitGroup
database table.
-
unit_id
¶ The reference to the
Unit
database table.
-
-
class
kepler.models.unit.
UnitResource
(unit_id, resource_id, count)¶ Bases:
sqlalchemy.ext.declarative.api.Base
The SQLAlchemy declarative model class for a
UnitResource
object holds information about what resources are needed to be able to reserve the unit.-
count
¶ The count of resources needed for the unit.
-
description_tr_id
¶ The optional (i.e. can be null) translation ID of the description for the usage and requirement of the resources by the unit.
-
resource_id
¶ The reference to the
Resource
database table.
-
unit_id
¶ The reference to the
Unit
database table.
-
-
class
kepler.models.unit.
UnitStatus
(unit_id, unit_status_type_id)¶ Bases:
kepler.models.models_meta.ModifiableBase
,sqlalchemy.ext.declarative.api.Base
The class represents a row in the
UnitStatus
database table that specifies unit status types for units.-
id
¶ The ID of the unit status.
-
modifier_id
¶
-
unit_id
¶ The reference to the
Unit
database table.
-
unit_status_type_id
¶ The reference to the
UnitStatusType
database table.
-
-
class
kepler.models.unit.
UnitStatusType
(name_tr_id)¶ Bases:
sqlalchemy.ext.declarative.api.Base
The class defines SQLAlchemy model for the status types of units.
-
active
¶ Specifies whether the unit status type is active or has been deactivated.
-
id
¶ The ID of the unit status type.
-
name_tr_id
¶ The translation ID of name of the unit status type.
-
-
class
kepler.models.unit.
UnitType
(name_tr_id)¶ Bases:
sqlalchemy.ext.declarative.api.Base
The SQLAlchemy declarative model class for a
UnitType
object holds information about the different kinds of types that can be attributed to the units.-
active
¶ Specifies whether the unit type is active or has been deactivated.
-
id
¶ The ID of the unit type.
-
name_tr_id
¶ The translation ID of the name of the unit type.
-