def theater(request, id): channel = get_object_or_404(Channel, id=id, type=Channel.TYPE_CINEMA) channels = [channel] city = request.GET.get('city') town = city and get_object_or_404(Town, pk=city) if town: theaters = Channel.objects.in_town(town) else: theaters = get_theaters(request) country_code = channel.town.country.code form = SelectTownForm(country_code, True, initial={ 'city': town and town.pk or '', }) date = get_date(request) past = 'past' in request.GET films = get_films(date, channels, request.user, past=past) return render( request, "showtimes/theater.html", { 'city_form': form, 'town': town, 'theaters': theaters, 'channel': channel, 'date': date, 'films': films, 'days': get_available_showtime_dates(request), })
def theater(request, id): channel = get_object_or_404(Channel, id=id, type=Channel.TYPE_CINEMA) channels = [channel] city = request.GET.get('city') town = city and get_object_or_404(Town, pk=city) if town: theaters = Channel.objects.in_town(town) else: theaters = get_theaters(request) country_code = channel.town.country.code form = SelectTownForm(country_code, True, initial={ 'city':town and town.pk or '', }) date = get_date(request) past = 'past' in request.GET films = get_films(date, channels, request.user, past=past) return render(request, "showtimes/theater.html", { 'city_form':form, 'town':town, 'theaters':theaters, 'channel':channel, 'date':date, 'films': films, 'days':get_available_showtime_dates(request), })
def theater(request, id): channel = get_object_or_404(Channel, id=id) channels = [channel] city = request.GET.get("city") town = city and get_object_or_404(Town, pk=city) if town: theaters = Channel.objects.in_town(town) else: theaters = get_theaters(request) country_code = channel.town.country.code form = SelectTownForm(country_code, True, initial={"city": town and town.pk or ""}) date = get_date(request) past = "past" in request.GET films = get_films(date, channels, request.user, past=past) return render( request, "showtimes/theater.html", { "city_form": form, "town": town, "theaters": theaters, "channel": channel, "date": date, "films": films, "days": get_available_showtime_dates(request), }, )
def get(self, *args, **kw): self.date = get_date(self.request) self.past = 'past' in self.request.GET self.with_rated = 'with_rated' in self.request.GET self.order_by = self.request.GET.get('order') self.channels = get_theaters(self.request) return super(Showtimes, self).get(*args, **kw)
def get(self, *args, **kw): self.date = get_date(self.request) self.past = "past" in self.request.GET self.with_rated = "with_rated" in self.request.GET self.order_by = self.request.GET.get("order") self.channels = get_theaters(self.request) return super(Showtimes, self).get(*args, **kw)