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,
TimezoneType,
TSVectorType,
URLType,
UUIDType,
)
@@ -100,6 +101,7 @@ __all__ = (
ScalarListType,
TimezoneType,
TSVectorType,
URLType,
UUIDType,
database_exists,
create_database,

View File

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