def hardware_hacker_tabs(user): l = [ ('Available', reverse('hw_list'), False), ] count = Request.pending_objects(user).count() if count: l.append(('Requested', reverse('hw_request'), count), ) active = Request.active_objects(user).count() if active: l.append(('Active', reverse('hw_active'), active), ) return l
def get_queryset(self): return Request.pending_objects(user_id=self.kwargs['id']).all()
def get_queryset(self): return Request.active_objects(self.request.user.pk).all()
def get_queryset(self): return Request.pending_objects(self.request.user.pk).all()
def get_queryset(self): return Request.active_overall().all()
def get_queryset(self): return Request.historic_objects(self.kwargs['id']).all()