Beispiel #1
0
from django.urls import path
from ebooks.api.views import (EbookListCreateAPIView, EbookDetailAPIView,
                              ReviewCreateAPIView, ReviewDetailAPIView)
# from ebooks.api.views import EbookAPIView

urlpatterns = [
    path('ebooks/', EbookListCreateAPIView.as_view(), name='ebook-list'),
    path('ebooks/<int:pk>/', EbookDetailAPIView.as_view(),
         name='ebook-detail'),
    # `ebook_pk` is from perform_create method on CreateAPIView:
    path('ebooks/<int:ebook_pk>/review/',
         ReviewCreateAPIView.as_view(),
         name='ebook-review'),
    path('reviews/<int:pk>',
         ReviewDetailAPIView.as_view(),
         name='review-detail'),
]
Beispiel #2
0
from django.urls import path
from ebooks.api.views import (
    EbookListCreateAPIView,
    EbookDetailAPIView,
    ReviewCreateAPIVew,
    ReviewDetailAPIView,
)

urlpatterns = [
    path("ebooks/", EbookListCreateAPIView.as_view(), name="ebook-list"),
    path("ebooks/<int:pk>", EbookDetailAPIView.as_view(), name="ebook-detail"),
    path(
        "ebooks/<int:ebook_pk>/review/",
        ReviewCreateAPIVew.as_view(),
        name="ebook-review",
    ),
    path("reviews/<int:pk>/", ReviewDetailAPIView.as_view(), name="review-detail"),
]
Beispiel #3
0
from django.urls import path
from ebooks.api.views import EbookDetailAPIView, EbookListCreateAPIView, ReviewCreateAPIView, ReviewDetailAPIView

urlpatterns = [
    path('ebooks/', EbookListCreateAPIView.as_view(), name='ebook-list'),
    path('ebooks/<int:pk>/', EbookDetailAPIView.as_view(), name='ebook-detail'),
    path('ebooks/<int:ebook_pk>/review/', ReviewCreateAPIView.as_view(), name='ebook-review'),
    path('reviews/<int:pk>/', ReviewDetailAPIView.as_view(), name='review-detail'),
]
Beispiel #4
0
from django.urls import path
from ebooks.api.views import EbookListCreateAPIView, EbookDetailAPIVIew, ReviewCreateAPIView, ReviewDetailAPIView

urlpatterns = [
    # path('ebooks/', EbookListCreateAPIView.as_view(), name="ebook-list"),
    path('ebooks/', EbookListCreateAPIView.as_view(), name="ebook-list"),
    path('ebooks/<int:pk>', EbookDetailAPIVIew.as_view(), name="ebook-detail"),
    path('ebooks/<int:ebook_pk>/review/', ReviewCreateAPIView.as_view(), name="ebook-review"),
    path('review/<int:pk>', ReviewDetailAPIView.as_view(), name="review-detail"),
]
Beispiel #5
0
from django.urls import path
from ebooks.api.views import EbookListCreateAPIView, EbookDetailAPIView, ReviewCreateAPIView, ReviewDetailAPIView


urlpatterns = [
    path('', EbookListCreateAPIView.as_view(), name="ebooks-list"),
    path('<int:pk>/', EbookDetailAPIView.as_view(), name="ebooks-detail"),
    path('<int:ebook_pk>/review/', ReviewCreateAPIView.as_view(), name="ebooks-review"),
    path('review/<int:ebook_pk>/', ReviewDetailAPIView.as_view(), name="ebooks-review-detail"),
]