models.py 796 Bytes
Newer Older
1
"""
2
ConfigurationModel for the mobile_api djangoapp.
3
"""
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

from django.db.models.fields import TextField

from config_models.models import ConfigurationModel


class MobileApiConfig(ConfigurationModel):
    """
    Configuration for the video upload feature.

    The order in which the comma-separated list of names of profiles are given
    is in priority order.
    """
    video_profiles = TextField(
        blank=True,
        help_text="A comma-separated list of names of profiles to include for videos returned from the mobile API."
    )

    @classmethod
    def get_video_profiles(cls):
        """
        Get the list of profiles in priority order when requesting from VAL
        """
27
        return [profile.strip() for profile in cls.current().video_profiles.split(",") if profile]