diff options
Diffstat (limited to 'bitbake/lib/toaster/toastergui/querysetfilter.py')
-rw-r--r-- | bitbake/lib/toaster/toastergui/querysetfilter.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bitbake/lib/toaster/toastergui/querysetfilter.py b/bitbake/lib/toaster/toastergui/querysetfilter.py index 62297e9b89..dbae239370 100644 --- a/bitbake/lib/toaster/toastergui/querysetfilter.py +++ b/bitbake/lib/toaster/toastergui/querysetfilter.py | |||
@@ -5,7 +5,7 @@ class QuerysetFilter(object): | |||
5 | if criteria: | 5 | if criteria: |
6 | self.set_criteria(criteria) | 6 | self.set_criteria(criteria) |
7 | 7 | ||
8 | def set_criteria(self, criteria): | 8 | def set_criteria(self, criteria = None): |
9 | """ | 9 | """ |
10 | criteria is an instance of django.db.models.Q; | 10 | criteria is an instance of django.db.models.Q; |
11 | see https://docs.djangoproject.com/en/1.9/ref/models/querysets/#q-objects | 11 | see https://docs.djangoproject.com/en/1.9/ref/models/querysets/#q-objects |
@@ -17,7 +17,10 @@ class QuerysetFilter(object): | |||
17 | Filter queryset according to the criteria for this filter, | 17 | Filter queryset according to the criteria for this filter, |
18 | returning the filtered queryset | 18 | returning the filtered queryset |
19 | """ | 19 | """ |
20 | return queryset.filter(self.criteria) | 20 | if self.criteria: |
21 | return queryset.filter(self.criteria) | ||
22 | else: | ||
23 | return queryset | ||
21 | 24 | ||
22 | def count(self, queryset): | 25 | def count(self, queryset): |
23 | """ Returns a count of the elements in the filtered queryset """ | 26 | """ Returns a count of the elements in the filtered queryset """ |