models.py 804 Bytes
Newer Older
1 2 3 4 5 6 7 8
"""
Models used by LMS XBlock infrastructure.

Includes:
    XBlockAsidesConfig: A ConfigurationModel for managing how XBlockAsides are
        rendered in the LMS.
"""

9 10 11 12
from django.db.models import TextField

from config_models.models import ConfigurationModel

13 14 15
from xblock.core import XBlockAside


16 17 18 19 20 21 22 23 24
class XBlockAsidesConfig(ConfigurationModel):
    """
    Configuration for XBlockAsides.
    """

    disabled_blocks = TextField(
        default="about course_info static_tab",
        help_text="Space-separated list of XBlocks on which XBlockAsides should never render."
    )
25 26 27 28 29 30 31

    @classmethod
    def possible_asides(cls):
        """
        Return a list of all asides that are enabled across all XBlocks.
        """
        return [aside_type for aside_type, __ in XBlockAside.load_classes()]