We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2ab1138 commit 4c0adadCopy full SHA for 4c0adad
uliweb_apijson/apijson/views.py
@@ -196,8 +196,18 @@ def _get_array(self,key):
196
return json({"code":400,"msg":"'%s' cannot filter with owner"%(modelname)})
197
198
for n in model_param:
199
- if n[0]!="@" and hasattr(model,n):
200
- q = q.filter(getattr(model.c,n)==model_param[n])
+ if n[0]!="@":
+ if n[-1]=="$":
201
+ name = n[:-1]
202
+ if hasattr(model,name):
203
+ q = q.filter(getattr(model.c,name).like(model_param[n]))
204
+ elif n[-1]=="}" and n[-2]=="{":
205
+ name = n[:-2]
206
207
+ # TODO
208
+ pass
209
+ elif hasattr(model,n):
210
+ q = q.filter(getattr(model.c,n)==model_param[n])
211
212
if query_type in [1,2]:
213
self.vars["/%s/total"%(key)] = q.count()
0 commit comments