Beispiel #1
0
from django.conf.urls import url
from cities.views import CityCreateView, CityListView, CityDetailView

urlpatterns = [
    url(r'^$', CityListView.as_view(), name="list"),
    url(r'^(?P<pk>\d+)/$', CityDetailView.as_view(), name="detail"),
    url(r'^create/$', CityCreateView.as_view(), name="create"),
]
Beispiel #2
0
from django.urls import path

from cities.views import CityDetailView, CityCreateView, CityUpdateView, CityDeleteView, CityListView

urlpatterns = [
    path('', CityListView.as_view(), name='home'),
    path('detail/<int:pk>/', CityDetailView.as_view(), name='detail'),
    path('add/', CityCreateView.as_view(), name='create'),
    path('update/<int:pk>', CityUpdateView.as_view(), name='update'),
    path('delete/<int:pk>', CityDeleteView.as_view(), name='delete'),
]
from django.urls import path
from cities.views import (CityRetrieveView, CityListView, CityCreateView,
                          CityUpdateView)

urlpatterns = [
    path('', CityListView.as_view()),
    path('<pk>', CityRetrieveView.as_view()),
    path('<pk>/update', CityUpdateView.as_view()),
    path('create/', CityCreateView.as_view())
]