예제 #1
0
def choose_show_guest(request):
    following = request.GET['following'].split(",")
    show_data = shows.get_show_by_id(request.GET['showid'], None)
    if "showid" in show_data and str(show_data["showid"]) in following:
        show_data = {"do_nothing": True}
    data = simplejson.dumps(show_data)

    return HttpResponse(data, mimetype='application/json')
예제 #2
0
def choose_show_guest(request):
    following = request.GET['following'].split(",")
    show_data = shows.get_show_by_id(request.GET['showid'], None)
    if "showid" in show_data and str(show_data["showid"]) in following:
        show_data = {"do_nothing": True}
    data = simplejson.dumps(show_data)

    return HttpResponse(data, mimetype='application/json')
예제 #3
0
def follow_show(request):
    show_data = None
    user = _validate_token(request)
    if user:
        showid = int(request.GET.get('showid', 0))
        show_data = shows.get_show_by_id(showid, user, client=True)
        shows.follow_show(showid, user)

    data = simplejson.dumps(show_data)
    return HttpResponse(data, mimetype='application/json')
예제 #4
0
def follow_show(request):
    show_data = None
    user = _validate_token(request)
    if user:
        showid = int(request.GET.get('showid', 0))
        show_data = shows.get_show_by_id(showid, user, client=True)
        shows.follow_show(showid, user)

    data = simplejson.dumps(show_data)
    return HttpResponse(data, mimetype='application/json')
예제 #5
0
def rpc_guest_load(request):
    following = request.GET['following'].split(",")
    shows_info = []
    for val in following:
        if val.isdigit():
            show_data = shows.get_show_by_id(val, None)
            shows_info.append(show_data)

    data = simplejson.dumps(shows_info)

    return HttpResponse(data, mimetype='application/json')
예제 #6
0
def home(request):
    """Home Page."""
    if request.session.get('new_user', False):
        shows_info = request.session["from_guest"]
        for val in shows_info:
            if val.isdigit():
                shows.get_show_by_id(val, request.user)
    shows_filter = ''
    if 'shows' in request.GET:
        shows_filter = request.GET['shows']
        request.session['filter'] = shows_filter
    elif request.session.get('filter', False):
        shows_filter = request.session['filter']
    else:
        shows_filter = 'all'
    data = shows.get_shows_per_user(request.user, shows_filter)
    most_rated = shows.get_most_rated_shows(request.user)
    data['recommended'] = most_rated
    data['filter'] = shows_filter
    return render_response(request, 'index.html', data)
예제 #7
0
def rpc_guest_load(request):
    following = request.GET['following'].split(",")
    shows_info = []
    for val in following:
        if val.isdigit():
            show_data = shows.get_show_by_id(val, None)
            shows_info.append(show_data)

    data = simplejson.dumps(shows_info)

    return HttpResponse(data, mimetype='application/json')
예제 #8
0
def home(request):
    """Home Page."""
    if request.session.get('new_user', False):
        shows_info = request.session["from_guest"]
        for val in shows_info:
            if val.isdigit():
                shows.get_show_by_id(val, request.user)
    shows_filter = ''
    if 'shows' in request.GET:
        shows_filter = request.GET['shows']
        request.session['filter'] = shows_filter
    elif request.session.get('filter', False):
        shows_filter = request.session['filter']
    else:
        shows_filter = 'all'
    data = shows.get_shows_per_user(request.user, shows_filter)
    most_rated = shows.get_most_rated_shows(request.user)
    data['recommended'] = most_rated
    data['filter'] = shows_filter
    return render_response(request, 'index.html', data)
예제 #9
0
def choose_show(request):
    show_data = shows.get_show_by_id(request.GET['showid'], request.user)
    data = simplejson.dumps(show_data)

    return HttpResponse(data, mimetype='application/json')
예제 #10
0
def choose_show(request):
    show_data = shows.get_show_by_id(request.GET['showid'], request.user)
    data = simplejson.dumps(show_data)

    return HttpResponse(data, mimetype='application/json')