예제 #1
0
from django.urls import path

from bookmark.views import BookmarkList, BookmarkCreateView, BookmarkDetailView, BookmarkUpdateView, BookmarkDeleteView

app_name = 'bookmark'

urlpatterns = [
    path('', BookmarkList.as_view(), name='list'),  # {% url 'bookmark:list %}
    path('add/', BookmarkCreateView.as_view(), name='add'),
    path('detail/<int:pk>/', BookmarkDetailView.as_view(), name='detail'),
    path('update/<int:pk>/', BookmarkUpdateView.as_view(), name='update'),
    path('delete/<int:pk>/', BookmarkDeleteView.as_view(), name='delete'),
]
예제 #2
0
from django.conf.urls import url

from bookmark.views import BookmarkLV, BookmarkDV, \
    BookmarkCreateView, BookmarkChangeView, BookmarkUpdateView, BookmarkDeleteView

urlpatterns = [
    url(r'^$', BookmarkLV.as_view(), name='index'),
    url(r'^(?P<pk>\d+)/$', BookmarkDV.as_view(), name='detail'),

    url(r'^add/$', BookmarkCreateView.as_view(), name='add'),
    url(r'^change/$', BookmarkChangeView.as_view(), name='change'),
    url(r'^(?P<pk>[0-9]+)/update/$', BookmarkUpdateView.as_view(), name='update'),
    url(r'^(?P<pk>[0-9]+)/delete/$', BookmarkDeleteView.as_view(), name='delete'),
]
예제 #3
0
파일: urls.py 프로젝트: nab5m/bookmark
from django.urls import path, reverse_lazy
from django.views.generic import ListView, DeleteView, DetailView

from bookmark.models import Bookmark
from bookmark.views import BookmarkCreateView, BookmarkUpdateView

app_name = "bookmark"

urlpatterns = [
    path('', ListView.as_view(model=Bookmark, paginate_by=5), name="index"),
    path('add/', BookmarkCreateView.as_view(), name="add"),
    path(
        'delete/<int:pk>/',
        DeleteView.as_view(
            model=Bookmark,
            success_url=reverse_lazy('bookmark:index'),
        ),
        name="delete",
    ),
    path('detail/<int:pk>', DetailView.as_view(model=Bookmark), name="detail"),
    path('update/<int:pk>', BookmarkUpdateView.as_view(), name="update"),
]
예제 #4
0
from django.conf.urls import url

from bookmark.views import BookmarkLV, BookmarkDV, BookmarkCreateView, BookmarkChangeLV, BookmarkUpdateView, \
    BookmarkDeleteView

urlpatterns = [
    # Class-based views for Bookmark app
    url(r'^$', BookmarkLV.as_view(), name='index'),
    url(r'^(?P<pk>\d+)/$', BookmarkDV.as_view(), name='detail'),

    # Example: /add/
    url(r'^add/$', BookmarkCreateView.as_view(), name="add"),

    # Example: /change/
    url(r'^change/$', BookmarkChangeLV.as_view(), name="change"),

    # Example: /99/update
    url(r'^(?P<pk>[0-9]+)/update/$',
        BookmarkUpdateView.as_view(),
        name="update"),

    # Example: /99/delete
    url(r'^(?P<pk>[0-9]+)/delete/',
        BookmarkDeleteView.as_view(),
        name="delete"),
]