Permalink
Browse files

updating to allow for UUID when using postgis backend

  • Loading branch information...
1 parent aef5121 commit 961dcbecbc2ec822d0b4c8b21ededbdf23b320a3 @binarydud committed Nov 30, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 uuidfield/fields.py
View
4 uuidfield/fields.py
@@ -1,4 +1,3 @@
-
from django.db.models import Field
import uuid
@@ -48,7 +47,8 @@ def _create_uuid(self):
return getattr(uuid, 'uuid%s' % (self.version,))(*args)
def db_type(self, connection=None):
- if connection.settings_dict['ENGINE'] == 'django.db.backends.postgresql_psycopg2':
+ _postgres_types = ['django.contrib.gis.db.backends.postgis','django.db.backends.postgresql_psycopg2']
+ if connection.settings_dict['ENGINE'] in _postgres_types:
return 'UUID'
else:
return 'char(%s)' % (self.max_length,)

0 comments on commit 961dcbe

Please sign in to comment.