Message ID | 20170106225259.3934-3-stephen@that.guru |
---|---|
State | Accepted |
Headers | show |
On 01/06/2017 04:52 PM, Stephen Finucane wrote: > Signed-off-by: Stephen Finucane <stephen@that.guru> > Cc: Andy Doan <andy.doan@linaro.org> > Cc: Andrew Donnellan <andrew.donnellan@au1.ibm.com> > --- > patchwork/api/series.py | 6 ++++-- > patchwork/tests/test_rest_api.py | 2 ++ > 2 files changed, 6 insertions(+), 2 deletions(-) I was just needing this feature today :) Reviewed-by: Andy Doan <andy.doan@linaro.org>
On Fri, 2017-01-20 at 10:22 -0600, Andy Doan wrote: > On 01/06/2017 04:52 PM, Stephen Finucane wrote: > > Signed-off-by: Stephen Finucane <stephen@that.guru> > > Cc: Andy Doan <andy.doan@linaro.org> > > Cc: Andrew Donnellan <andrew.donnellan@au1.ibm.com> > > --- > > patchwork/api/series.py | 6 ++++-- > > patchwork/tests/test_rest_api.py | 2 ++ > > 2 files changed, 6 insertions(+), 2 deletions(-) > > I was just needing this feature today :) > > Reviewed-by: Andy Doan <andy.doan@linaro.org> Thank you, sir. Merged both of these :) Stephen
diff --git a/patchwork/api/series.py b/patchwork/api/series.py index ade37fb..44cf87f 100644 --- a/patchwork/api/series.py +++ b/patchwork/api/series.py @@ -29,12 +29,14 @@ class SeriesSerializer(HyperlinkedModelSerializer): class Meta: model = Series - fields = ('id', 'url', 'name', 'date', 'submitter', 'version', 'total', - 'received_total', 'received_all', 'cover_letter', 'patches') + fields = ('id', 'url', 'project', 'name', 'date', 'submitter', + 'version', 'total', 'received_total', 'received_all', + 'cover_letter', 'patches') read_only_fields = ('date', 'submitter', 'total', 'received_total', 'received_all', 'cover_letter', 'patches') extra_kwargs = { 'url': {'view_name': 'api-series-detail'}, + 'project': {'view_name': 'api-project-detail'}, 'submitter': {'view_name': 'api-person-detail'}, 'cover_letter': {'view_name': 'api-cover-detail'}, 'patches': {'view_name': 'api-patch-detail'}, diff --git a/patchwork/tests/test_rest_api.py b/patchwork/tests/test_rest_api.py index 0d1c702..cc1fcef 100644 --- a/patchwork/tests/test_rest_api.py +++ b/patchwork/tests/test_rest_api.py @@ -490,6 +490,8 @@ class TestSeriesAPI(APITestCase): def assertSerialized(self, series_obj, series_json): self.assertEqual(series_obj.id, series_json['id']) self.assertEqual(series_obj.name, series_json['name']) + self.assertIn(TestProjectAPI.api_url(series_obj.project.id), + series_json['project']) self.assertIn(TestPersonAPI.api_url(series_obj.submitter.id), series_json['submitter']) self.assertEqual(series_obj.patches.count(),
Signed-off-by: Stephen Finucane <stephen@that.guru> Cc: Andy Doan <andy.doan@linaro.org> Cc: Andrew Donnellan <andrew.donnellan@au1.ibm.com> --- patchwork/api/series.py | 6 ++++-- patchwork/tests/test_rest_api.py | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-)