[RFC 09/11] REST: Add query parameters to filter patches by

Andy Doan andy.doan at linaro.org
Thu May 19 12:54:56 AEST 2016


On 05/17/2016 08:43 AM, Finucane, Stephen wrote:
>>>> diff --git a/patchwork/views/rest_api.py b/patchwork/views/rest_api.py
>> >
>>>> > >>+    query_filters = {
>>>> > >>+        'project': 'project__name',
>>>> > >>+        'submitter': 'submitter__name',
>>>> > >>+        'delegate': 'delegate__name',
>>>> > >>+        'state': 'state__name',
>>>> > >>+        'since': 'date__gt',
>>>> > >>+        'until': 'date__lt',
>>>> > >>+    }
>>>> > >>+
>>> > >
>>> > >This seems to be a reinvention of parts of 'filters.py'. Could that
>>> > >code be integrated here in any way?
>> >
>> >Its probably possible. Would probably require some re-work of
>> >filters.py to support things like since and until and the default
>> >listing needs to be all patches.
>> >
>> >I see a couple of ways forward:
>> >
>> >  * leave this patch out for now and revisit
>> >  * leave the patch as is
>> >  * take the time now to integrate nicely with filters.py
>> >
>> >let me know what you'd like to see.
> If it doesn't cost us anything, I would favour leaving this feature out
> for now and reviewing as a separate series (option 1). I'd be concerned
> about bringing more tech debt on our heads by choosing another option.
> In addition, there's probably more things we can do here - e.g. adding
> 'updated_at' and 'created_at' fields to some models, that would make
> things easier. Are you OK with this?

I'd already dropped it from my v3 patchset with the same conclusion :)


More information about the Patchwork mailing list