def get_queryset(self): iid = self.kwargs.get('iid') self.sort_by = self.request.GET.get('sort', "mod_desc") if self.sort_by not in paginate_sort_opts.keys(): self.sort_by = "mod_desc" self.workgroup = get_object_or_404(MDR.Workgroup, pk=iid) # self.check_user_permission() return MDR._concept.objects.filter(workgroup=iid).select_subclasses().order_by( *paginate_sort_opts.get(self.sort_by))
def get_queryset(self): iid = self.kwargs.get('iid') self.sort_by = self.request.GET.get('sort', "mod_desc") if self.sort_by not in paginate_sort_opts.keys(): self.sort_by = "mod_desc" self.workgroup = get_object_or_404(MDR.Workgroup, pk=iid) # self.check_user_permission() return MDR._concept.objects.filter(workgroup=iid).select_subclasses().order_by( *paginate_sort_opts.get(self.sort_by))
def get_sort(self): sort_by = self.request.GET.get('sort', "name_asc") if sort_by not in paginate_sort_opts.keys(): sort_by = "name_asc" return sort_by