Created
April 4, 2014 10:14
-
-
Save kezabelle/9971763 to your computer and use it in GitHub Desktop.
django-uuidfield fix to prefetch_related. No idea what else it breaks instead though :|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf.urls import patterns, include, url | |
from uuidfield import UUIDField | |
# Fix the bloody UUID field so that we can do prefetching. | |
UUIDField._old_to_python = UUIDField.to_python | |
def maybe_fix_to_python(self, value): | |
return unicode(UUIDField._old_to_python(self, value=value)) | |
UUIDField.to_python = maybe_fix_to_python |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment