Several optimizations for improving vertical rendering performance.
This commit is contained in:
@@ -4,8 +4,12 @@ API methods related to xblock state.
|
||||
|
||||
|
||||
from xblock_django.models import XBlockConfiguration, XBlockStudioConfiguration
|
||||
from openedx.core.lib.cache_utils import CacheInvalidationManager
|
||||
|
||||
cacher = CacheInvalidationManager(model=XBlockConfiguration)
|
||||
|
||||
|
||||
@cacher
|
||||
def deprecated_xblocks():
|
||||
"""
|
||||
Return the QuerySet of deprecated XBlock types. Note that this method is independent of
|
||||
@@ -14,6 +18,7 @@ def deprecated_xblocks():
|
||||
return XBlockConfiguration.objects.current_set().filter(deprecated=True)
|
||||
|
||||
|
||||
@cacher
|
||||
def disabled_xblocks():
|
||||
"""
|
||||
Return the QuerySet of disabled XBlock types (which should not render in the LMS).
|
||||
|
||||
@@ -6,10 +6,8 @@ Models.
|
||||
from config_models.models import ConfigurationModel
|
||||
from django.db import models
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.encoding import python_2_unicode_compatible
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class XBlockConfiguration(ConfigurationModel):
|
||||
"""
|
||||
XBlock configuration used by both LMS and Studio, and not specific to a particular template.
|
||||
@@ -35,7 +33,6 @@ class XBlockConfiguration(ConfigurationModel):
|
||||
).format(self.name, self.enabled, self.deprecated)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class XBlockStudioConfigurationFlag(ConfigurationModel):
|
||||
"""
|
||||
Enables site-wide Studio configuration for XBlocks.
|
||||
@@ -52,7 +49,6 @@ class XBlockStudioConfigurationFlag(ConfigurationModel):
|
||||
return "XBlockStudioConfigurationFlag(enabled={})".format(self.enabled)
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class XBlockStudioConfiguration(ConfigurationModel):
|
||||
"""
|
||||
Studio editing configuration for a specific XBlock/template combination.
|
||||
|
||||
Reference in New Issue
Block a user