direct lookup

This commit is contained in:
j 2013-07-17 18:58:15 +00:00
parent 197c5ca9ff
commit d6d1a08e40

View file

@ -109,8 +109,9 @@ def getSequence(request):
data = json.loads(request.POST['data']) data = json.loads(request.POST['data'])
response = json_response() response = json_response()
position = float('%0.03f' % data['position']) position = float('%0.03f' % data['position'])
i = Item.objects.get(itemId=data['id'])
qs = models.Sequence.objects.filter( qs = models.Sequence.objects.filter(
sort__item__itemId=data['id'], sort_id=i.sort.pk,
mode=models.Sequence.MODE[data['mode']], mode=models.Sequence.MODE[data['mode']],
start__lte=position, start__lte=position,
end__gt=position end__gt=position