Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 1.8+ #63

Open
rjmoggach opened this issue Feb 14, 2016 · 1 comment
Open

Django 1.8+ #63

rjmoggach opened this issue Feb 14, 2016 · 1 comment

Comments

@rjmoggach
Copy link

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.

@ryneeverett
Copy link

Isn't this package unnecessary in django 1.8+ due to the built-in UUIDField?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants