I don't have a pull request for you as I'm using the field in a slightly different way that isn't reusable but here's what I did. You'll probably want to do some checks to maintain backwards compatibility as this will break old versions.
I removed the import of SubfieldBase and the following line in the class:
# __metaclass__ = SubfieldBase
and added the class method:
def from_db_value(self, value, expression, connection, context):
if value is None:
return value
return self.get_db_prep_value(value)
Django 1.8 dropped
SubFieldBase
I don't have a pull request for you as I'm using the field in a slightly different way that isn't reusable but here's what I did. You'll probably want to do some checks to maintain backwards compatibility as this will break old versions.
I removed the import of
SubfieldBase
and the following line in the class:and added the class method:
I haven't tested this either.