from django.urls import path{% if is_cbv %}, include{% endif %}

{% if is_cbv %}
from rest_framework.routers import DefaultRouter

from .views import ItemViewSet

router = DefaultRouter()
router.register(r"items", ItemViewSet, basename="item")

urlpatterns = router.urls
{% else %}
from . import views

urlpatterns = [
    path("items/", views.item_list, name="item-list"),
    path("items/<int:pk>/", views.item_detail, name="item-detail"),
]
{% endif %}
