Пример #1
0
def playback(request):
    uid = None
    r = [408, None]
    
    if request.method == "GET":
        if request.GET.has_key("uid"):
            uid = request.GET["uid"]
    else:
        if request.GET.has_key("uid"): # prendere uid dalla HEAD non GET
            uid = request.GET["uid"]
    
    if uid:
        r = ArchiveManager.check_record(uid)
        if request.method == "GET" and r[0] == 200:
            return HttpResponse(open(r[1], "rb").read(), mimetype="audio/wav")
    
    return HttpResponse(status = r[0])
Пример #2
0
def search_record(request, c):
    data = []
    if len(c) == 15:
        data = ArchiveManager.find_record_history(c)
    data = simplejson.dumps(data)
    return HttpResponse(data, mimetype="application/json")