Skip to content

Commit

Permalink
updating to allow for UUID when using postgis backend
Browse files Browse the repository at this point in the history
  • Loading branch information
binarymatt committed Nov 30, 2011
1 parent aef5121 commit 961dcbe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions uuidfield/fields.py
@@ -1,4 +1,3 @@

from django.db.models import Field

import uuid
Expand Down Expand Up @@ -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,)
Expand Down

0 comments on commit 961dcbe

Please sign in to comment.