dcramer / django-uuidfield

A UUIDField for Django
BSD 3-Clause "New" or "Revised" License
262 stars 115 forks source link

Django 1.8+ #63

Open rjmoggach opened 8 years ago

rjmoggach commented 8 years ago

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 commented 8 years ago

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