Constants
Constants are used whenever we store values in the database which are chosen from a very limited set.
Defining constants here adds an abstract layer on top of the actual values that are stored in the database.
This improves readability of the code, enables auto-completion of values and minimizes the risk of mistakes.
The actual values which are stored in the database are completely irrelevant, because neither the developer,
nor the end users gets to see them.
The developer only sees the defined constant, and the end user only sees the (translated) string representation
defined in a mapping which is called CHOICES for every submodule.
Allowed Media
This module contains a list of Mime-Types that are allowed to be uploaded.
- integreat_compass.cms.constants.allowed_media.CHOICES = [('image/png', 'PNG image'), ('image/jpeg', 'JPEG image'), ('application/pdf', 'PDF document')]
Allowed MIME types that can be uploaded.
[ ('image/png', 'PNG image'), ('image/jpeg', 'JPEG image'), ('application/pdf', 'PDF document'), ]
- integreat_compass.cms.constants.allowed_media.DOCUMENTS = [('application/pdf', 'PDF document')]
MIME types of document files. Expand this list to add further data types.
[('application/pdf', 'PDF document')]
- integreat_compass.cms.constants.allowed_media.IMAGES = [('image/png', 'PNG image'), ('image/jpeg', 'JPEG image')]
MIME type of image files. Expand this list to add further data types.
[('image/png', 'PNG image'), ('image/jpeg', 'JPEG image')]
- integreat_compass.cms.constants.allowed_media.JPEG = 'image/jpeg'
MIME type of JPEG files
- integreat_compass.cms.constants.allowed_media.PDF = 'application/pdf'
MIME type of GIF files
- integreat_compass.cms.constants.allowed_media.PNG = 'image/png'
MIME type of PNG files
Group Names
This module contains the possible names of roles to make them translatable.
- integreat_compass.cms.constants.group_names.CHOICES = [('BOARD_MEMBER', 'Board Member'), ('INTEGRATION_SPECIALIST', 'Integration Specialist'), ('OFFER_PROVIDER', 'Offer Provider')]
Choices for non-staff roles
[ ('BOARD_MEMBER', 'Board Member'), ('INTEGRATION_SPECIALIST', 'Integration Specialist'), ('OFFER_PROVIDER', 'Offer Provider'), ]
Namespaces
This module contains the namespaces used in this project.
Offer Group Types
This module contains all string representations of all group types in which offers
can be offered, used by Offer
Offer Mode Types
This module contains all string representations of all mode types in which offers
can be offered, used by Offer
Offer Version States
This module contains all string representations of all approval states of offer
versions, used by OfferVersion