@@ -174,6 +174,13 @@ class CheckFilter(TimestampMixin, FilterSet):
class EventFilter(ProjectMixin, TimestampMixin, FilterSet):
+ patch = ModelChoiceFilter(queryset=Patch.objects.only('pk', 'name'))
+ series = ModelChoiceFilter(queryset=Series.objects.only('pk', 'name'))
+ cover = ModelChoiceFilter(queryset=CoverLetter.objects.only('pk', 'name'))
+
+ def filter_patch(self, queryset, name, value):
+ return queryset.only('pk', 'name')
+
class Meta:
model = Event
fields = ('project', 'category', 'series', 'patch', 'cover')
The filter widget is pretty dumb, containing a full list of every patch in the system. We will want to rework this in the future, but for now just minimize the amount of data we're pulling in. Signed-off-by: Stephen Finucane <stephen@that.guru> --- patchwork/api/filters.py | 7 +++++++ 1 file changed, 7 insertions(+)