def street_view_json(request, street_id): """ Download the JSON for the requests that built the page. """ requests = Request.objects.filter(street=street_id) return json_response_from(requests)
def neighborhood_detail_json(request, neighborhood_id): """ Download JSON of the requests that built the page. Caution: slow! TODO: Speed it up. """ neighborhood = Geography.objects.get(pk=neighborhood_id) requests = Request.objects.filter(geo_point__contained=neighborhood.geo) return json_response_from(requests)