def events(request, template_name='dashboard/events.html', *args, **kwargs): user = request.user if 'teams' in request.GET: events = team_events_for_user(user) else: events = all_events_for_user(user) return dregni.views.index( request, template_name=template_name, filter_qs=lambda qs: events, *args, **kwargs )
def index(request, template_name='dashboard/index.html'): user = request.user team_actions = team_actions_for_user(user) team_topics = team_topics_for_user(user) events = all_events_for_user(user) template_context = { 'team_actions': team_actions, 'team_topics': team_topics, 'events': events, } return render_to_response( template_name, template_context, RequestContext(request), )