2015-07-27 12:55:35 +00:00
|
|
|
import json
|
|
|
|
from urllib.parse import parse_qs
|
|
|
|
|
|
|
|
from django.http import HttpResponse
|
|
|
|
|
|
|
|
from .helpers import get_history_data
|
|
|
|
from .models import ResourceData
|
|
|
|
|
|
|
|
|
|
|
|
def history_data(request):
|
|
|
|
ids = map(int, parse_qs(request.META['QUERY_STRING'])['ids'][0].split(','))
|
|
|
|
queryset = ResourceData.objects.filter(id__in=ids)
|
|
|
|
history = get_history_data(queryset)
|
2015-07-28 10:49:20 +00:00
|
|
|
response = json.dumps(history, indent=4)
|
2015-07-27 12:55:35 +00:00
|
|
|
return HttpResponse(response, content_type="application/json")
|