Fix py3 compat
This commit is contained in:
@@ -3,6 +3,7 @@ try:
|
|||||||
import intervals
|
import intervals
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
import six
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
from sqlalchemy import types
|
from sqlalchemy import types
|
||||||
from ..exceptions import ImproperlyConfigured
|
from ..exceptions import ImproperlyConfigured
|
||||||
@@ -50,9 +51,7 @@ class RangeComparator(types.TypeEngine.Comparator):
|
|||||||
self.type.interval_class.type,
|
self.type.interval_class.type,
|
||||||
tuple,
|
tuple,
|
||||||
list,
|
list,
|
||||||
str,
|
) + six.string_types
|
||||||
unicode
|
|
||||||
)
|
|
||||||
|
|
||||||
if isinstance(other, coerced_types):
|
if isinstance(other, coerced_types):
|
||||||
other = self.type.interval_class(other)
|
other = self.type.interval_class(other)
|
||||||
@@ -122,7 +121,7 @@ class IntRangeType(RangeType):
|
|||||||
"""
|
"""
|
||||||
IntRangeType provides way for saving range of numbers into database.
|
IntRangeType provides way for saving range of numbers into database.
|
||||||
|
|
||||||
Example ::
|
Example::
|
||||||
|
|
||||||
|
|
||||||
from sqlalchemy_utils import IntRangeType
|
from sqlalchemy_utils import IntRangeType
|
||||||
@@ -146,8 +145,7 @@ class IntRangeType(RangeType):
|
|||||||
|
|
||||||
|
|
||||||
IntRangeType returns the values as IntInterval objects. These objects
|
IntRangeType returns the values as IntInterval objects. These objects
|
||||||
support many arithmetic operators:
|
support many arithmetic operators::
|
||||||
::
|
|
||||||
|
|
||||||
|
|
||||||
meeting = Event(name=u'meeting')
|
meeting = Event(name=u'meeting')
|
||||||
|
Reference in New Issue
Block a user