Hi,
I have a simple view in Django:
@render_to('episode_list.html')
def list_episodes(request, season):
query = Episode.objects.filter(season=season)
seasons = query[0].series.total_seasons
return {'episodes': query,
'season': season,
'max_seasons':range(1,seasons + 1)}
I'm trying to build the navigation on my template dynamically and need 'max_seasons' to do it... Is there some better way to get this information, since it seems like this would make an extra database query.
The '.series' is referring to a foreign key.