def process_page(request, resource_id = None): if 'text/html' not in http_accept(request): return process_resource(request, resource_id) tmp_g = find_resource_by_id(resource_id) context = {'results': tmp_g.serialize()} return mm_render_to_response(request, context, 'viewer.html')
def process_page(request, resource_id = None): if 'text/html' not in request.META.get('HTTP_ACCEPT', None): process_resource(request, resource_id) tmp_g = find_resource_by_id(resource_id) context = {'results': tmp_g.serialize()} return mm_render_to_response(request, context, 'viewer.html')
def process_data(request, resource_id): req_format = _validateMimeFormat(request) if req_format is None: return process_resource(request, resource_id) tmp_g = find_resource_by_id(resource_id) return HttpResponse(tmp_g.serialize(format = req_format), mimetype = request.META.get('HTTP_ACCEPT'))
def process_data(request, resource_id): if 'text/html' in http_accept(request): return process_resource(request, resource_id = None) req_format = validateMimeFormat(request) if req_format is None: return process_resource(request, resource_id) tmp_g = find_resource_by_id(resource_id) return HttpResponse(tmp_g.serialize(format = req_format), mimetype = FORMAT_MAP.get(req_format))