Merge branch 'master' of github.com:kvesteri/sqlalchemy-utils

This commit is contained in:
Konsta Vesterinen
2014-01-13 17:26:02 +02:00
2 changed files with 4 additions and 1 deletions

View File

@@ -46,6 +46,7 @@ from .types import (
ScalarListException, ScalarListException,
TimezoneType, TimezoneType,
TSVectorType, TSVectorType,
URLType,
UUIDType, UUIDType,
) )
@@ -100,6 +101,7 @@ __all__ = (
ScalarListType, ScalarListType,
TimezoneType, TimezoneType,
TSVectorType, TSVectorType,
URLType,
UUIDType, UUIDType,
database_exists, database_exists,
create_database, create_database,

View File

@@ -54,11 +54,12 @@ class JSONType(sa.types.TypeDecorator):
""" """
impl = sa.UnicodeText impl = sa.UnicodeText
def __init__(self): def __init__(self, *args, **kwargs):
if json is None: if json is None:
raise ImproperlyConfigured( raise ImproperlyConfigured(
'JSONType needs anyjson package installed.' 'JSONType needs anyjson package installed.'
) )
super(JSONType, self).__init__(*args, **kwargs)
def load_dialect_impl(self, dialect): def load_dialect_impl(self, dialect):
if dialect.name == 'postgresql': if dialect.name == 'postgresql':