def food_list_view(request, campus): spots = get_filtered_spots(request, campus, "food") context = {"spots": spots, "campus": campus, "count": len(spots), "app_type": 'food'} return render_to_response('scout/food/list.html', context, context_instance=RequestContext(request))
def hybrid_study_list_view(request, campus): spots = get_filtered_spots(request, campus, "study") grouped_spots = group_spots_by_building(spots) context = {"spots": spots, "campus": campus, "grouped_spots": grouped_spots, "count": len(spots), "app_type": 'study'} return render_to_response('hybridize/study/list.html', context, context_instance=RequestContext(request))
def get_context_data(self, **kwargs): self.template_name = kwargs['template_name'] spots = get_filtered_spots(self.request, kwargs['campus'], "food") context = { "spots": spots, "campus": kwargs['campus'], "count": len(spots), "app_type": 'food', "campus_locations": CAMPUS_LOCATIONS } return context
def get_context_data(self, **kwargs): self.template_name = kwargs['template_name'] spots = get_filtered_spots(self.request, kwargs['campus'], "study") grouped_spots = group_spots_by_building(spots) context = { "spots": spots, "campus": kwargs['campus'], "grouped_spots": grouped_spots, "count": len(spots), "app_type": 'study', "campus_locations": CAMPUS_LOCATIONS } return context
def tech_list_view(request, campus): # spots = get_spots_by_filter([('has_items', 'true')]) spots = get_filtered_spots(request, campus, "tech") spots = get_filtered_items(spots, request) count = get_item_count(spots) if count <= 0: spots = [] context = {"spots": spots, "campus": campus, "count": count, "app_type": 'tech'} return render_to_response('scout/tech/list.html', context, context_instance=RequestContext(request))
def get_context_data(self, **kwargs): self.template_name = kwargs['template_name'] # spots = get_spots_by_filter([('has_items', 'true')]) self.request.GET = self.request.GET.copy() self.request.GET['item_is_active'] = 'true' spots = get_filtered_spots(self.request, kwargs['campus'], "tech") spots = get_filtered_items(spots, self.request) count = get_item_count(spots) if count <= 0: spots = [] context = { "spots": spots, "campus": kwargs['campus'], "count": count, "app_type": 'tech', "campus_locations": CAMPUS_LOCATIONS } return context
def hybrid_food_list_view(request, campus): spots = get_filtered_spots(request, campus, "food") context = {"spots": spots, "campus": campus} return render_to_response('hybridize/food/list.html', context, context_instance=RequestContext(request))