diff --git a/Show/views.py b/Show/views.py index 2c9d158..1646a0c 100644 --- a/Show/views.py +++ b/Show/views.py @@ -23,14 +23,14 @@ class IndexView(TemplateView): ctx = super().get_context_data() # Get show by abbreviation, add episode count to the show and return only the first object - show = Show.objects.filter(abbr=abbreviation).annotate(episode_count=Count('episodes')).first() + show = Show.objects.filter(abbr=abbreviation).first() # 404 if not show: raise Http404("Show does not exist") # Get all seasons of the show and annotate episode counts onto them - seasons = show.seasons.all().annotate(episode_count=Count('episodes')) + seasons = show.seasons.all() # Add fields to context ctx['show'] = show