Skip to content

Django 1.8+ #63

Description

@rjmoggach

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:

# __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)

I haven't tested this either.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions