find local ids

This commit is contained in:
j 2013-02-25 13:30:42 +00:00
parent dadf1af1e6
commit 1594bec79e

View file

@ -369,21 +369,15 @@ def findId(request):
data = json.loads(request.POST['data']) data = json.loads(request.POST['data'])
response = json_response({}) response = json_response({})
response['data']['items'] = [] response['data']['items'] = []
''' if 'id' in data:
FIXME: can not handle query for director [] qs = models.Item.objects.filter(itemId=data['id'])
query = parse_query(data, request.user)
qs = _order_query(query['qs'], query['sort'])
if qs.count() == 1: if qs.count() == 1:
response['data']['items'] = [i.get_json(data['keys']) for i in qs] response['data']['items'] = [
elif settings.DATA_SERVICE: i.get_json(['title', 'director', 'year', 'id']) for i in qs
''' ]
if settings.DATA_SERVICE: if not response['data']['items'] \
''' and len(data['id']) == 7 \
info = {} and settings.DATA_SERVICE:
for c in data['query']['conditions']:
info[c['key']] = c['value']
r = models.external_data('getId', info)
'''
r = models.external_data('getId', data) r = models.external_data('getId', data)
if r['status']['code'] == 200: if r['status']['code'] == 200:
response['data']['items'] = [r['data']] response['data']['items'] = [r['data']]