Constants

To represent some fixed set of available options internally, we usually use enums internally. To store such data in the database, we represent it by integers.

However, at some places in our interface, these integers are actually presented to users without further processing. In particular, this is the case for the event export described in detail at Partieller Import as well as for some advanced facilities for moderators and admins.

To help interpret these values, we provide the following list.

cdedb.database.constants

Translation of numeric constants to semantic values.

This file takes care of encoding mostly enum-like things into the correct numeric values. The raw values should never be used, instead their symbolic names provided by this module should be used.

class cdedb.database.constants.AssemblyLogCodes(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Available log messages core.log.

assembly_changed = 2
assembly_concluded = 3
assembly_created = 1
assembly_deleted = 4
assembly_presider_added = 35
assembly_presider_removed = 36
attachment_added = 40
attachment_changed = 42
attachment_removed = 41
attachment_version_added = 50
attachment_version_changed = 52
attachment_version_removed = 51
ballot_changed = 11
ballot_created = 10
ballot_deleted = 12
ballot_extended = 13
ballot_tallied = 14
candidate_added = 20
candidate_removed = 22
candidate_updated = 21
new_attendee = 30
class cdedb.database.constants.AttachmentPolicy(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Regulate allowed payloads for mails to lists.

This is currently only a tri-state, so we implement it as an enum.

allow = 1
forbid = 3
pdf_only = 2

allow the mime-type application/pdf but nothing else

class cdedb.database.constants.CdeLogCodes(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Available log messages cde.log.

class cdedb.database.constants.CoreLogCodes(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Available log messages core.log.

delete_email_status = 71
genesis_approved = 21
genesis_change = 28
genesis_deleted = 23
genesis_merged = 25
genesis_rejected = 22
genesis_request = 20
genesis_verified = 24
modify_email_status = 70
password_change = 10
password_invalidated = 13
password_reset = 12
persona_archived = 3
persona_change = 2
persona_creation = 1
persona_dearchived = 4
persona_purged = 5
privilege_change_approved = 31
privilege_change_pending = 30
privilege_change_rejected = 32
quota_violation = 60
realm_change = 40
reply_to_anonymous_message = 101
rotate_anonymous_message = 102
send_anonymous_message = 100
username_change = 50
class cdedb.database.constants.CourseTrackGroupType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
class cdedb.database.constants.EmailStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Spec for status of core.email_status.

This is intended to be extended in future revisions. Potential further states are: whitelist, unconfirmed, mailinglists_disabled, all_disabled, removed, unsuccessful_transmission.

classmethod notable_states() tuple[cdedb.database.constants.EmailStatus, ...]

States which should cause a notification.

In some locations annotating every state could get really noisy.

class cdedb.database.constants.EventFeeType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Different kinds of event fees, to be displayed and/or treated differently.

class cdedb.database.constants.EventLogCodes(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Available log messages event.log.

course_changed = 41
course_created = 40
course_deleted = 44
course_segment_activity_changed = 43
course_segments_changed = 42
custom_filter_changed = 96
custom_filter_created = 95
custom_filter_deleted = 97
event_archived = 4
event_changed = 2
event_created = 1
event_deleted = 3
event_locked = 60
event_partial_import = 62
event_unlocked = 61
fee_modifier_changed = 81
fee_modifier_created = 80
fee_modifier_deleted = 82
field_added = 20
field_removed = 22
field_updated = 21
lodgement_changed = 25
lodgement_created = 26
lodgement_deleted = 27
lodgement_group_changed = 71
lodgement_group_created = 70
lodgement_group_deleted = 72
minor_form_removed = 86
minor_form_updated = 85
orga_added = 10
orga_removed = 11
orga_token_changed = 201
orga_token_created = 200
orga_token_deleted = 203
orga_token_revoked = 202
part_changed = 16
part_created = 15
part_deleted = 17
part_group_changed = 101
part_group_created = 100
part_group_deleted = 102
personalized_fee_amount_deleted = 401
personalized_fee_amount_set = 400
query_deleted = 91
query_stored = 90
questionnaire_changed = 30
registration_changed = 51
registration_created = 50
registration_deleted = 52
registration_payment_received = 55
registration_payment_reimbursed = 56
registration_status_changed = 300
track_added = 35
track_group_changed = 111
track_group_created = 110
track_group_deleted = 112
track_removed = 37
track_updated = 36
class cdedb.database.constants.EventPartGroupType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
class cdedb.database.constants.FieldAssociations(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Coordinates fields to the entities they are attached to.

course = 2
lodgement = 3
registration = 1
class cdedb.database.constants.FieldDatatypes(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Spec for the datatypes available as custom data fields.

bool = 2
date = 5
datetime = 6
float = 4
int = 3
non_negative_float = 12
non_negative_int = 10
phone = 20
str = 1
class cdedb.database.constants.FinanceLogCodes(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Available log messages cde.finance_log.

deduct_membership_fee = 11
end_trial_membership = 12
gain_membership = 2
grant_lastschrift = 20
honorary_membership_granted = 51
honorary_membership_revoked = 52
increase_balance = 10
lastschrift_deleted = 23
lastschrift_transaction_cancelled = 34
lastschrift_transaction_failure = 32
lastschrift_transaction_issue = 30
lastschrift_transaction_revoked = 35
lastschrift_transaction_skip = 33
lastschrift_transaction_success = 31
lose_membership = 3
manual_balance_correction = 13
modify_lastschrift = 22
new_member = 1
other = 99

Fallback for strange cases

remove_balance_on_archival = 14
remove_exmember_balance = 17
revoke_lastschrift = 21
start_trial_membership = 15
class cdedb.database.constants.Genders(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Spec for field gender of core.personas.

female = 1
male = 2
not_specified = 20
other = 10

this is a catch-all for complicated reality

class cdedb.database.constants.GenesisStati(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Spec for field case_status of core.genesis_cases.

approved = 3

acked by reviewer, but not yet created

existing_updated = 5

finished (existing persona updated, challenge archived)

rejected = 10

reviewed and rejected (also a final state)

successful = 4

finished (persona created, challenge archived)

to_review = 2

email confirmed, awaiting review

unconfirmed = 1

created, data logged, email unconfirmed

class cdedb.database.constants.LastschriftTransactionStati(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Basically store the outcome (if it exists) of a transaction.

cancelled = 12
failure = 11
is_finalized() bool

Whether the transaction was already tallied.

issued = 1
rollback = 20
skipped = 2
success = 10
class cdedb.database.constants.LockType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Types of Locks.

mailman = 1
class cdedb.database.constants.MailinglistDomain(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
display_str() str

Return a readable string representation to be displayed in the UI.

get_acceptable_aliases() set[str]

Return alias domains which might exist for a given type.

This is only used to allow emails to <local_part>@alias to be sent to the list members without moderation.

get_domain() str

Return the actual domain for this enum member.

class cdedb.database.constants.MailinglistRosterVisibility(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Visibility of the subscriber list to non-moderators or admins.

Roster of inactive mailinglists are always hidden.

class cdedb.database.constants.MailinglistTypes(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
class cdedb.database.constants.MlLogCodes(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Available log messages for ml.log.

automatically_removed = 28
email_trouble = 40
list_changed = 2
list_created = 1
list_deleted = 3
marked_blocked = 25

SubscriptionState.unsubscription_override

marked_override = 24

SubscriptionState.subscription_override

moderate_accept = 50
moderate_discard = 52
moderate_reject = 51
moderator_added = 10
moderator_removed = 11
request_approved = 30
request_blocked = 33
request_cancelled = 32
request_denied = 31
reset = 27
subscribed = 21

SubscriptionState.subscribed

subscription_changed = 22

This is now used for address changes.

subscription_requested = 20

SubscriptionState.subscription_requested

unsubscribed = 23

SubscriptionState.unsubscribed

whitelist_added = 12
whitelist_removed = 13
class cdedb.database.constants.ModerationPolicy(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Regulate posting of mail to a list.

fully_moderated = 3
non_subscribers = 2

subscribers may post without moderation, but external mail is reviewed

unmoderated = 1
class cdedb.database.constants.NotifyOnRegistration(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Options for how often orgas want to be notified about new registrations.

class cdedb.database.constants.PastEventLogCodes(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Available log messages past_event.log.

course_changed = 11
course_created = 10
course_deleted = 12
event_changed = 2
event_created = 1
event_deleted = 3
participant_added = 20
participant_removed = 21
class cdedb.database.constants.PastInstitutions(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Insitutions for (primarily past) events, used for sorting into categories.

basf = 80
bub = 70
cde = 1
dja = 40
dsa = 20
eisenberg = 400
jgw = 60
van = 200
class cdedb.database.constants.PersonaChangeStati(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Spec for field code of core.changelog.

committed = 2
displaced = 12

replaced by a change which could not wait

nacked = 11
pending = 1
superseded = 10
class cdedb.database.constants.PrivilegeChangeStati(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Spec for field status of core.privilege_changes.

approved = 2

approved by another admin

pending = 1

initialized, pending for review

rejected = 10

rejected by another admin

successful = 3

successfully applied

class cdedb.database.constants.QuestionnaireUsages(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Where a questionnaire row will be displayed.

allow_fee_condition() bool

Whether or not rows with this usage may use fee condition fields.

allow_readonly() bool

Whether or not rows with this usage are allowed to be readonly.

class cdedb.database.constants.RegistrationPartStati(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Spec for field status of event.registration_parts.

applied = 1
cancelled = 5
guest = 4
has_to_pay() bool

Any status which should pay the participation fee.

is_involved() bool

Any status which warrants further attention by the orgas.

is_present() bool

Any status which will be on site for the event.

not_applied = -1
participant = 2
rejected = 6
waitlist = 3
cdedb.database.constants.n_(x: str) str

Clone of cdedb.common.n_() for marking translatable strings.