def trends_listings(request): context = get_status(request) context['app'] = 'items_panel' context['country_sites'] = country_sites(user_country_access(request.user)) context['form'] = TrendsPanelForm( user=request.user, initial=request.session.get('form_session')) return render_to_response('trends_panel.html', context, context_instance=RequestContext(request))
def filter_user(self, user): return self.queryset.filter(country__in=user_country_access(user))
def filter_user(self, user): countries = user_country_access(user) return self.queryset.filter(site__country__in=countries)