Fix WeekDaysType support for py33
This commit is contained in:
@@ -16,5 +16,7 @@ class BitType(sa.types.TypeDecorator):
|
|||||||
# Use the native BIT type for drivers that has it.
|
# Use the native BIT type for drivers that has it.
|
||||||
if dialect.name == 'postgresql':
|
if dialect.name == 'postgresql':
|
||||||
return dialect.type_descriptor(BIT(self.length))
|
return dialect.type_descriptor(BIT(self.length))
|
||||||
|
elif dialect.name == 'sqlite':
|
||||||
|
return dialect.type_descriptor(sa.String(self.length))
|
||||||
else:
|
else:
|
||||||
return dialect.type_descriptor(type(self.impl)(self.length))
|
return dialect.type_descriptor(type(self.impl)(self.length))
|
||||||
|
@@ -48,6 +48,10 @@ class WeekDaysType(types.TypeDecorator, ScalarCoercible):
|
|||||||
|
|
||||||
impl = BitType(WeekDay.NUM_WEEK_DAYS)
|
impl = BitType(WeekDay.NUM_WEEK_DAYS)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def comparator_factory(self):
|
||||||
|
return self.impl.comparator_factory
|
||||||
|
|
||||||
def process_bind_param(self, value, dialect):
|
def process_bind_param(self, value, dialect):
|
||||||
if isinstance(value, WeekDays):
|
if isinstance(value, WeekDays):
|
||||||
return value.as_bit_string()
|
return value.as_bit_string()
|
||||||
|
Reference in New Issue
Block a user