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.
|
||||
if dialect.name == 'postgresql':
|
||||
return dialect.type_descriptor(BIT(self.length))
|
||||
elif dialect.name == 'sqlite':
|
||||
return dialect.type_descriptor(sa.String(self.length))
|
||||
else:
|
||||
return dialect.type_descriptor(type(self.impl)(self.length))
|
||||
|
@@ -48,6 +48,10 @@ class WeekDaysType(types.TypeDecorator, ScalarCoercible):
|
||||
|
||||
impl = BitType(WeekDay.NUM_WEEK_DAYS)
|
||||
|
||||
@property
|
||||
def comparator_factory(self):
|
||||
return self.impl.comparator_factory
|
||||
|
||||
def process_bind_param(self, value, dialect):
|
||||
if isinstance(value, WeekDays):
|
||||
return value.as_bit_string()
|
||||
|
Reference in New Issue
Block a user