Remove SubfieldBase metaclass

This commit is contained in:
Brian Beggs
2017-10-23 14:08:08 -04:00
parent c12923838f
commit ca92ffe21d
9 changed files with 42 additions and 18 deletions

View File

@@ -7,6 +7,8 @@ from config_models.models import ConfigurationModel
from django.db import models
from django.utils.text import compress_string
from openedx.core.djangoapps.util.model_utils import CreatorMixin
logger = logging.getLogger(__name__) # pylint: disable=invalid-name
@@ -40,12 +42,10 @@ def decompress_string(value):
return ret
class CompressedTextField(models.TextField):
class CompressedTextField(CreatorMixin, models.TextField):
""" TextField that transparently compresses data when saving to the database, and decompresses the data
when retrieving it from the database. """
__metaclass__ = models.SubfieldBase
def get_prep_value(self, value):
""" Compress the text data. """
if value is not None: