Skip to content

Commit f596a11

Browse files
committed
First attempt at for issue django-json-api#410 didn't have includes sorted properly.
- travis caught it. This time I've done the isort locally to confirm the order. - MIDDLEWARE_CLASSES was replaced by MIDDLEWARE as of Django 1.10 and, according to tox.ini, this is only testing >=1.11.
1 parent cb5317d commit f596a11

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

example/settings/dev.py

-4
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@
5959

6060
PASSWORD_HASHERS = ('django.contrib.auth.hashers.UnsaltedMD5PasswordHasher', )
6161

62-
MIDDLEWARE_CLASSES = (
63-
'debug_toolbar.middleware.DebugToolbarMiddleware',
64-
)
65-
6662
MIDDLEWARE = (
6763
'debug_toolbar.middleware.DebugToolbarMiddleware',
6864
)

example/urls.py

+18-5
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@
33
from rest_framework import routers
44

55
from example.views import (
6+
AuthorRelationshipView,
67
AuthorViewSet,
8+
BlogRelationshipView,
79
BlogViewSet,
10+
CommentRelationshipView,
811
CommentViewSet,
912
CompanyViewset,
10-
EntryViewSet,
11-
ProjectViewset,
1213
EntryRelationshipView,
14+
EntryViewSet,
15+
NonPaginatedEntryViewSet,
16+
ProjectViewset
1317
)
1418

1519
router = routers.DefaultRouter(trailing_slash=False)
@@ -23,13 +27,22 @@
2327

2428
urlpatterns = [
2529
url(r'^', include(router.urls)),
26-
url(r'^entries/(?P<pk>[^/.]+)/relationships/(?P<related_field>\w+)',
27-
EntryRelationshipView.as_view(),
28-
name='entry-relationships'),
2930
url(r'^entries/(?P<entry_pk>[^/.]+)/suggested/',
3031
EntryViewSet.as_view({'get': 'list'}),
3132
name='entry-suggested'
3233
),
34+
url(r'^entries/(?P<pk>[^/.]+)/relationships/(?P<related_field>\w+)',
35+
EntryRelationshipView.as_view(),
36+
name='entry-relationships'),
37+
url(r'^blogs/(?P<pk>[^/.]+)/relationships/(?P<related_field>\w+)',
38+
BlogRelationshipView.as_view(),
39+
name='blog-relationships'),
40+
url(r'^comments/(?P<pk>[^/.]+)/relationships/(?P<related_field>\w+)',
41+
CommentRelationshipView.as_view(),
42+
name='comment-relationships'),
43+
url(r'^authors/(?P<pk>[^/.]+)/relationships/(?P<related_field>\w+)',
44+
AuthorRelationshipView.as_view(),
45+
name='author-relationships'),
3346
]
3447

3548

0 commit comments

Comments
 (0)