urls.py 886 B

12345678910111213141516171819
  1. from django.urls import path
  2. from . import views
  3. app_name = 'todo'
  4. urlpatterns = [
  5. path('', views.tasklist_list, name='list-tasklists'),
  6. path('<str:tasklist_slug>/', views.tasklist_detail, name='show-tasklist'),
  7. path('<str:tasklist_slug>/completed/', views.tasklist_detail, {'completed': True}, name='show-tasklist-completed'),
  8. path('<str:tasklist_slug>/reorder/', views.tasklist_reorder, name='reorder-tasklist'),
  9. path('<str:tasklist_slug>/add/', views.task_form, name='add-task'),
  10. path('<str:tasklist_slug>/<int:task_id>/', views.task_detail, name='show-task'),
  11. path('<str:tasklist_slug>/<int:task_id>/toggle-done/', views.task_toggle_done, name='toggle-task-done'),
  12. path('<str:tasklist_slug>/<int:task_id>/edit/', views.task_form, name='edit-task'),
  13. path('<str:tasklist_slug>/<int:task_id>/delete/', views.task_delete, name='delete-task'),
  14. ]