Added search bar to collection list
This commit is contained in:
@@ -184,7 +184,7 @@ class LibraryWorkListView(WorkListView):
|
||||
return True
|
||||
|
||||
def get_works(self):
|
||||
collections = models.Collection.objects
|
||||
collections = models.Collection.objects.all()
|
||||
|
||||
if not self.request.user.is_superuser:
|
||||
collections = collections.filter(administrators=self.request.user)
|
||||
@@ -204,9 +204,9 @@ class CollectionWorkListView(WorkListView):
|
||||
def get_works(self):
|
||||
works = Work.objects.filter(collection=self.kwargs['collection'])
|
||||
|
||||
if self.request.is_admin:
|
||||
loan_count = Count('project_items', Q(project_items__checkout__lte=now(), project_items__returned=None))
|
||||
works = works.annotate(loan_count=loan_count)
|
||||
#if self.request.is_admin:
|
||||
# loan_count = Count('project_items', Q(project_items__checkout__lte=now(), project_items__returned=None))
|
||||
# works = works.annotate(loan_count=loan_count)
|
||||
return works
|
||||
|
||||
def get_context_data(self, *args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user