summaryrefslogtreecommitdiff
path: root/patchwork/urls.py
diff options
context:
space:
mode:
authorStephen Finucane <stephen@that.guru>2016-11-04 14:17:46 +0000
committerStephen Finucane <stephen@that.guru>2016-12-23 23:41:34 +0000
commitf1d7c8f7dca818ef4df0b22a7f9f879ff59da782 (patch)
tree2e353c7e9b670953d763f5fee951227e882dddc9 /patchwork/urls.py
parent4d36190ac7013dd96b57915a11ecdeeee03bbcb5 (diff)
downloadpatchwork-f1d7c8f7dca818ef4df0b22a7f9f879ff59da782.tar
patchwork-f1d7c8f7dca818ef4df0b22a7f9f879ff59da782.tar.gz
REST: Add '/series' endpoint
Adopt a hybrid approach, by adding an additional series endpoint to the existing patch endpoint: /series/${series_id}/ /patches/${patch_id}/ This is based on the approach described here: http://softwareengineering.stackexchange.com/a/275007/106804 This is necessary due to the N:N mapping of series and patches: it's possible for a patch to belong to many series, and a series usually contains many patches. This means it is not possible to rely on the patch endpoint alone. It is also necessary to add a cover letter endpoint, such that the series body can include this. Signed-off-by: Stephen Finucane <stephen@that.guru>
Diffstat (limited to 'patchwork/urls.py')
-rw-r--r--patchwork/urls.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/patchwork/urls.py b/patchwork/urls.py
index 56db24c..68aefc2 100644
--- a/patchwork/urls.py
+++ b/patchwork/urls.py
@@ -154,9 +154,11 @@ if settings.ENABLE_REST_API:
from patchwork.api import check as api_check_views
from patchwork.api import index as api_index_views
+ from patchwork.api import cover as api_cover_views
from patchwork.api import patch as api_patch_views
from patchwork.api import person as api_person_views
from patchwork.api import project as api_project_views
+ from patchwork.api import series as api_series_views
from patchwork.api import user as api_user_views
api_patterns = [
@@ -175,6 +177,12 @@ if settings.ENABLE_REST_API:
url(r'^people/(?P<pk>[^/]+)/$',
api_person_views.PersonDetail.as_view(),
name='api-person-detail'),
+ url(r'^covers/$',
+ api_cover_views.CoverLetterList.as_view(),
+ name='api-cover-list'),
+ url(r'^covers/(?P<pk>[^/]+)/$',
+ api_cover_views.CoverLetterDetail.as_view(),
+ name='api-cover-detail'),
url(r'^patches/$',
api_patch_views.PatchList.as_view(),
name='api-patch-list'),
@@ -187,6 +195,12 @@ if settings.ENABLE_REST_API:
url(r'^patches/(?P<patch_id>[^/]+)/checks/(?P<check_id>[^/]+)/$',
api_check_views.CheckDetail.as_view(),
name='api-check-detail'),
+ url(r'^series/$',
+ api_series_views.SeriesList.as_view(),
+ name='api-series-list'),
+ url(r'^series/(?P<pk>[^/]+)/$',
+ api_series_views.SeriesDetail.as_view(),
+ name='api-series-detail'),
url(r'^projects/$',
api_project_views.ProjectList.as_view(),
name='api-project-list'),