def actors(request): sort_key = request.GET.get('sort', DEFAULT_SORT) sort = VALID_ACTORS_SORT.get(sort_key, DEFAULT_SORT) #TODO: Ordered by Bacon number instead of alphabetically. if sort == 'bacon': actors_all = Actors.all_ordered_alphabetically() else: actors_all = Actors.all_ordered_alphabetically() if 'search_query' in request.GET: return search_actors(request, actors_all) else: return render_to_response('tvmaniacs/actors.html', {'Actors': actors_all, 'page_limit': Actors.page_limit()}, context_instance=RequestContext(request))
def actors(request): sort_key = request.GET.get('sort', DEFAULT_SORT) sort = VALID_ACTORS_SORT.get(sort_key, DEFAULT_SORT) #TODO: Ordered by Bacon number instead of alphabetically. if sort == 'bacon': actors_all = Actors.all_ordered_alphabetically() else: actors_all = Actors.all_ordered_alphabetically() if 'search_query' in request.GET: return search_actors(request, actors_all) else: return render_to_response('tvmaniacs/actors.html', { 'Actors': actors_all, 'page_limit': Actors.page_limit() }, context_instance=RequestContext(request))