kepler.models.constants module¶
The module contains some configurable constant values that are used elsewhere in Kepler to avoid unnecessarily complicated database queries.
-
class
kepler.models.constants.
Language
¶ Bases:
enum.IntEnum
The class defines the enumeration for language IDs in the database.
-
class
kepler.models.constants.
ReservationStatusType
¶ Bases:
enum.IntEnum
The class defines the enumeration for the IDs in the
ReservationStatusType
database table.-
active_id
= None¶ The reservation is active.
-
did_not_attend_id
= None¶ One or any of the users did not attend the event (NOTE: This should be modeled as a separate table.)
-
superuser_canceled_id
= None¶ The reservation is canceled by superuser or cascaded from time slot cancellation.
-
user_canceled_id
= None¶ Canceled by one of the users from the user group that made the reservation.
-
-
class
kepler.models.constants.
ResourceStatusType
¶ Bases:
enum.IntEnum
The class defines the enumeration for some of the IDs in
ReservationStatusType
database table.-
available_id
= None¶ The resource is available for use.
-
broken_id
= None¶ The resource is broken and thus unavailable for use.
-
deleted_id
= None¶ The resource has been deleted.
The resource is unavailable for use.
-
-
class
kepler.models.constants.
Role
¶ Bases:
enum.IntEnum
The class defines the enumeration for some of the IDs in
Role
database table. Using negative IDs so that the ID sequence of “dynamic roles” can start from 0 or positive.-
student_id
= None¶ The role ID for user.
-
superuser_id
= None¶ The role ID for superuser.
-
-
class
kepler.models.constants.
TimeSlotStatusType
¶ Bases:
enum.IntEnum
The class defines the enumeration for the IDs in the
TimeSlotStatusType
database table.-
active_id
= None¶ The time slot is active.
-
canceled_id
= None¶ The time slot has been canceled.
-
planned_id
= None¶ The time slot is in planning state and thus not visible for reservations.
-
-
class
kepler.models.constants.
UnitStatusType
¶ Bases:
enum.IntEnum
The class defines the enumeration for IDs in
UnitStatusType
database table.-
active_id
= None¶ The unit is active and can be reserved.
-
deleted_id
= None¶ The unit has been deleted.
-
-
class
kepler.models.constants.
UserGroupType
¶ Bases:
enum.IntEnum
The class defines the enumeration for the IDs in the UserGroupType database table.
-
personal_id
= None¶ The special group type for the automatically created personal user group.
The group type for user groups that can have multiple members.
-
-
class
kepler.models.constants.
UserInfoType
¶ Bases:
enum.IntEnum
The class defines the enumeration for the IDs in the
UserInfoType
database table.
-
kepler.models.constants.
get_language_id_from_locale
(locale_name)¶ The utility function maps a locale name to the corresponding language ID. The locale name refers to the language part of the locale. If no matching locale name is found, the default language ID is returned.
Parameters: locale_name – The locale name whose language ID is wanted. Returns: The language ID that corresponds to the specified locale name.
-
kepler.models.constants.
is_valid_locale_name
(locale_name)¶ The utility function checks if a language with the specified locale name is found in the system.
Parameters: locale_name – The locale name to be checked. Returns: True if the specified locale name is found in the system, otherwise false.