Skip to content

Commit f393e0e

Browse files
committed
fix py2/3 compatible, request by vaneoooo
1 parent e996030 commit f393e0e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

uliweb_apijson/apijson/views.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#coding=utf-8
22
from uliweb import expose, functions, models, UliwebError
33
from uliweb.orm import ModelNotFound
4+
from uliweb.utils._compat import string_types
45
from sqlalchemy.sql import and_, or_, not_
56
from json import loads
67
from collections import OrderedDict
@@ -224,7 +225,7 @@ def _get_filter_condition(self,model,model_param,item,expr=False):
224225
return self._expr(model,model_param,model_expr=item)
225226
else:
226227
raise UliwebError("item can be array only in @expr: '%s'"%(item))
227-
if not isinstance(item,str):
228+
if not isinstance(item,string_types):
228229
raise UliwebError("item should be array or string: '%s'"%(item))
229230
n = item
230231
if n[0]=="@":

0 commit comments

Comments
 (0)