|
3 | 3 | from rest_framework import routers
|
4 | 4 |
|
5 | 5 | from example.views import (
|
| 6 | + AuthorRelationshipView, |
6 | 7 | AuthorViewSet,
|
| 8 | + BlogRelationshipView, |
7 | 9 | BlogViewSet,
|
| 10 | + CommentRelationshipView, |
8 | 11 | CommentViewSet,
|
9 | 12 | CompanyViewset,
|
10 |
| - EntryViewSet, |
11 |
| - ProjectViewset, |
12 | 13 | EntryRelationshipView,
|
| 14 | + EntryViewSet, |
| 15 | + NonPaginatedEntryViewSet, |
| 16 | + ProjectViewset |
13 | 17 | )
|
14 | 18 |
|
15 | 19 | router = routers.DefaultRouter(trailing_slash=False)
|
|
23 | 27 |
|
24 | 28 | urlpatterns = [
|
25 | 29 | url(r'^', include(router.urls)),
|
26 |
| - url(r'^entries/(?P<pk>[^/.]+)/relationships/(?P<related_field>\w+)', |
27 |
| - EntryRelationshipView.as_view(), |
28 |
| - name='entry-relationships'), |
29 | 30 | url(r'^entries/(?P<entry_pk>[^/.]+)/suggested/',
|
30 | 31 | EntryViewSet.as_view({'get': 'list'}),
|
31 | 32 | name='entry-suggested'
|
32 | 33 | ),
|
| 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'), |
33 | 46 | ]
|
34 | 47 |
|
35 | 48 |
|
|
0 commit comments