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,7 +7,7 @@ import warnings
from django.core.exceptions import ValidationError
from django.db import models
from opaque_keys.edx.keys import BlockTypeKey, CourseKey, UsageKey
from openedx.core.djangoapps.util.model_utils import CreatorMixin
from xmodule.modulestore.django import modulestore
log = logging.getLogger(__name__)
@@ -68,7 +68,7 @@ def _strip_value(value, lookup='exact'):
return stripped_value
class OpaqueKeyField(models.CharField):
class OpaqueKeyField(CreatorMixin, models.CharField):
"""
A django field for storing OpaqueKeys.
@@ -81,8 +81,6 @@ class OpaqueKeyField(models.CharField):
"""
description = "An OpaqueKey object, saved to the DB in the form of a string."
__metaclass__ = models.SubfieldBase
Empty = object()
KEY_CLASS = None