show selected/wanted files
This commit is contained in:
parent
3c3f932c68
commit
74f777e0d1
5 changed files with 121 additions and 40 deletions
|
|
@ -326,6 +326,38 @@ def autocomplete(request):
|
|||
return render_to_json_response(response)
|
||||
actions.register(autocomplete)
|
||||
|
||||
def findId(request):
|
||||
'''
|
||||
param data {
|
||||
'query': query,
|
||||
'sort': array,
|
||||
'range': array
|
||||
}
|
||||
|
||||
'''
|
||||
data = json.loads(request.POST['data'])
|
||||
response = json_response({})
|
||||
response['data']['items'] = []
|
||||
'''
|
||||
FIXME: can not handle query for director []
|
||||
query = parse_query(data, request.user)
|
||||
qs = _order_query(query['qs'], query['sort'])
|
||||
if qs.count() == 1:
|
||||
response['data']['items'] = [i.get_json(data['keys']) for i in qs]
|
||||
elif settings.DATA_SERVICE:
|
||||
'''
|
||||
if settings.DATA_SERVICE:
|
||||
'''
|
||||
info = {}
|
||||
for c in data['query']['conditions']:
|
||||
info[c['key']] = c['value']
|
||||
r = models.external_data('getId', info)
|
||||
'''
|
||||
r = models.external_data('getId', data)
|
||||
if r['status']['code'] == 200:
|
||||
response['data']['items'] = [r['data']]
|
||||
return render_to_json_response(response)
|
||||
actions.register(findId)
|
||||
|
||||
def get(request):
|
||||
'''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue