Skip to content

Commit

Permalink
api: Add series/patch filtering capabilities to the events list
Browse files Browse the repository at this point in the history
Suggested-by: Cezar Burlacu <cezar.burlacu@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
  • Loading branch information
Damien Lespiau committed Apr 5, 2016
1 parent 555afb1 commit 4eda125
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/rest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ Events
:query name: Filter the events by name. This field is a comma separated
list of events names.

:query series: Filter the events by series id.

:query patch: Filter the events by patch id.

Each event type has some ``parameters`` specific to that event. At the moment,
two events are possible:

Expand Down Expand Up @@ -673,7 +677,8 @@ API Revisions
- Document how lists of objects work.
- Make all DateTime field serialize to ISO 8061 format and not the ECMA 262
subset.
- Add a ``since`` GET parameter to /projects/${id,linkname}/events/
- Add ``since``, ``name``, ``series`` and ``patch`` GET parameters to
/projects/${id,linkname}/events/

**Revision 1**

Expand Down
2 changes: 2 additions & 0 deletions patchwork/views/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,8 @@ def filter_name(self, queryset, event_names):

since = django_filters.CharFilter(name='event_time', lookup_type='gt')
name = django_filters.MethodFilter()
series = django_filters.NumberFilter()
patch = django_filters.NumberFilter()

class Meta:
model = EventLog
Expand Down

0 comments on commit 4eda125

Please sign in to comment.