Example #1
0
def xml(request):
    try:
        id = int(request.GET['event'])
    except (KeyError, ValueError):
        raise Http404
    
    ev = EventInfo(id)
    return HttpResponse('<?xml version="1.0" ?>\n' + ev.xml())
Example #2
0
def plot(request, dpi=65):
    try:
        id = int(request.GET['event'])
    except (KeyError, ValueError):
        raise Http404
        
    ev = EventInfo(id)
    
    canvas = ev.plot(dpi=dpi)
    response = HttpResponse(content_type='image/png')
    canvas.print_png(response)
    return response