Misc. cleanup for Python 3
This commit is contained in:
parent
189bc1faa8
commit
ee35cc6f22
24 changed files with 49 additions and 36 deletions
tailbone/grids
|
@ -153,7 +153,7 @@ class GridFilter(object):
|
|||
self.default_active = default_active
|
||||
self.default_verb = default_verb
|
||||
self.default_value = default_value
|
||||
for key, value in kwargs.iteritems():
|
||||
for key, value in kwargs.items():
|
||||
setattr(self, key, value)
|
||||
|
||||
def __repr__(self):
|
||||
|
@ -369,7 +369,7 @@ class AlchemyByteStringFilter(AlchemyStringFilter):
|
|||
|
||||
def get_value(self, value=UNSPECIFIED):
|
||||
value = super(AlchemyByteStringFilter, self).get_value(value)
|
||||
if isinstance(value, unicode):
|
||||
if isinstance(value, six.text_type):
|
||||
value = value.encode(self.value_encoding)
|
||||
return value
|
||||
|
||||
|
@ -415,7 +415,7 @@ class AlchemyNumericFilter(AlchemyGridFilter):
|
|||
# term for integer field...
|
||||
|
||||
def value_invalid(self, value):
|
||||
return bool(value and len(unicode(value)) > 8)
|
||||
return bool(value and len(six.text_type(value)) > 8)
|
||||
|
||||
def filter_equal(self, query, value):
|
||||
if self.value_invalid(value):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue