def get_context_data(self, **kwargs): context = super(ContactCRUDL.Cases, self).get_context_data(**kwargs) cases = Case.get_all(self.request.org, self.request.user).filter(contact=self.object).order_by('-opened_on') cases = cases.prefetch_related('labels').select_related('contact', 'assignee') context['object_list'] = cases return context
def get_context_data(self, **kwargs): context = super(ContactCRUDL.Cases, self).get_context_data(**kwargs) cases = (Case.get_all(self.request.org, self.request.user).filter( contact=self.object).order_by("-opened_on")) cases = cases.prefetch_related("labels").select_related( "contact", "assignee") context["object_list"] = cases return context
def get_context_data(self, **kwargs): context = super(ContactCRUDL.Cases, self).get_context_data(**kwargs) cases = Case.get_all(self.request.org, self.request.user).filter( contact=self.object).order_by('-opened_on') cases = cases.prefetch_related('labels').select_related( 'contact', 'assignee') context['object_list'] = cases return context