def workgroup_archives(request): text_filter = request.GET.get('filter', None) workgroups = request.user.profile.workgroups.filter(archived=True) if text_filter: workgroups = workgroups.filter(Q(name__icontains=text_filter) | Q(definition__icontains=text_filter)) context = {'filter': text_filter} return paginated_workgroup_list(request, workgroups, "aristotle_mdr/user/userWorkgroupArchives.html", context)
def workgroup_archives(request): text_filter = request.GET.get('filter', None) workgroups = request.user.profile.workgroups.filter(archived=True) if text_filter: workgroups = workgroups.filter(Q(name__icontains=text_filter) | Q(definition__icontains=text_filter)) context = {'filter': text_filter} return paginated_workgroup_list(request, workgroups, "aristotle_mdr/user/userWorkgroupArchives.html", context)
def dispatch(self, request, *args, **kwargs): super(ListWorkgroup, self).dispatch(request, *args, **kwargs) workgroups = MDR.Workgroup.objects.all() text_filter = request.GET.get('filter', "") if text_filter: workgroups = workgroups.filter(Q(name__icontains=text_filter) | Q(definition__icontains=text_filter)) context = {'filter': text_filter} return paginated_workgroup_list(request, workgroups, self.template_name, context)