]> git.ipfire.org Git - thirdparty/patchwork.git/commit
REST: Fix versioning
authorStephen Finucane <stephen@that.guru>
Wed, 26 Apr 2017 23:58:03 +0000 (00:58 +0100)
committerStephen Finucane <stephen@that.guru>
Fri, 28 Apr 2017 22:52:04 +0000 (23:52 +0100)
commit5094cfdbf0b11af44f979b16e43e8cce36378322
tree9b95ee6b274c991ea21371fd4c842b1e22ffc4f7
parentf75be7ed94ab98769b1c1fbcdef80a1c643724d5
REST: Fix versioning

One of the few remaining warts in the API is versioning. There is some
basic versioning there, but it doesn't work properly as-is. Fix this by
correcting the index endpoint ('/') to use Django REST Framework's
'reverse' function [1], which handles versioning for us [2] and
switching from 'NamespaceVersioning' to 'URLPathVersioning', the latter
of which does the same thing but in a different way.

[1] http://www.django-rest-framework.org/api-guide/reverse/#reverse
[2] http://www.django-rest-framework.org/api-guide/versioning/#reversing-urls-for-versioned-apis
[3] http://www.django-rest-framework.org/api-guide/versioning/#urlpathversioning

Signed-off-by: Stephen Finucane <stephen@that.guru>
patchwork/api/check.py
patchwork/api/event.py
patchwork/api/index.py
patchwork/api/patch.py
patchwork/settings/base.py
patchwork/urls.py