def showtimes_tv_single_day(request, date): channels = get_tv_channels(request) past = 'past' in request.GET with_rated = 'with_rated' in request.GET date = parse_date(request, date) films = get_films(date, channels, request.user, without_unmatched=True, past=past, with_rated=with_rated) ctx = dict( date=date, films=films, ) if not 'ajax' in request.GET: template = 'showtimes/films_tv_single_day.html' else: template = 'showtimes/films_tv_single_day_ajax.html' return render(request, template, ctx)
def showtimes_tv(request, by_film=True, type=Channel.TYPE_CINEMA): today = get_today(request.timezone) channels = get_tv_channels(request) past = 'past' in request.GET with_rated = 'with_rated' in request.GET days = [] all_films = [] for day in (0, 1, 2): date = today + datetime.timedelta(days=day) films = get_films(date, channels, request.user, without_unmatched=True, past=past, with_rated=with_rated)[:TV_FILMS_PER_DAY + 1] has_more = len(films) > TV_FILMS_PER_DAY films = films[:TV_FILMS_PER_DAY] if films: days.append({'date': date, 'films': films, 'has_more': has_more}) all_films.extend(films) ctx = dict( days=days, films=all_films, ) return render(request, "showtimes/films_tv.html", ctx)
def showtimes_tv(request, by_film=True, type=Channel.TYPE_CINEMA): today = get_today(request.timezone) channels = get_tv_channels(request) past = 'past' in request.GET with_rated = 'with_rated' in request.GET days = [] all_films = [] for day in (0, 1, 2): date = today + datetime.timedelta(days=day) films = get_films(date, channels, request.user, without_unmatched=True, past=past, with_rated=with_rated)[:TV_FILMS_PER_DAY + 1] has_more = len(films) > TV_FILMS_PER_DAY films = films[:TV_FILMS_PER_DAY] if films: days.append({'date':date, 'films':films, 'has_more':has_more}) all_films.extend(films) ctx = dict( days=days, films=all_films, ) return render(request, "showtimes/films_tv.html", ctx)
def showtimes_tv_single_day(request, date): channels = get_tv_channels(request) past = "past" in request.GET with_rated = "with_rated" in request.GET date = parse_date(request, date) films = get_films(date, channels, request.user, without_unmatched=True, past=past, with_rated=with_rated) ctx = dict(date=date, films=films) if not "ajax" in request.GET: template = "showtimes/films_tv_single_day.html" else: template = "showtimes/films_tv_single_day_ajax.html" return render(request, template, ctx)