Esempio n. 1
0
def tvdata_ajax(request): #{{{
    """ Viewer page """
    print(request.POST)
    date = request.POST.get("date")
    compare = request.POST.get("compare")
    station = request.POST.get("station")
    params = {'test':'test'}
    if compare is not None:
        params['epg']    = EPG.get_timetable_for_compare(date, station)
        params['rating'] = Rating.get_rating_by_station(date, station)
        return render_json_response(params)
    elif date:
        date_from = date + " 00:00:00"
        date_to = date + " 23:59:59"
        params['epg']    = EPG.get_timetable(date_from, date_to)
        params['rating'] = Rating.get_rating_by_time(date_from, date_to)
        return render_json_response(params)
    else:
        return render_json_response({'error':'error'})
Esempio n. 2
0
def search_program_ajax(request):
    # title = request.GET.get("title", False)
    title = request.POST.get("title", False)
    res = EPG.search_programs_by_title(title)
    return render_json_response(res)
Esempio n. 3
0
def mean_ratings_ajax(request):
    # title = request.GET.get("title", False)
    title = request.POST.get("title", False)
    res = EPG.get_mean_ratings_by_title(title)
    return render_json_response(res)