urls.py 1.5 KB

1234567891011121314151617181920212223242526272829303132
  1. from django.urls import path
  2. from tickets.views import *
  3. from tickets.api import views as apiviews
  4. app_name = "tickets"
  5. urlpatterns = [
  6. path("", TicketListView.as_view(), name="ticket_list_list"),
  7. path("search/", search, name="search"),
  8. path("ticket_list_create/", TicketListCreateView.as_view(), name="ticket_list_create"),
  9. path("my_tickets/", ticket_list_detail, {"my_tickets": True}, name="my_tickets"),
  10. path("assignments/", ticket_list_detail, {"assignments": True}, name="assignments"),
  11. path("<int:pk>/", ticket_list_detail, name="ticket_list_detail"),
  12. path("<int:pk>/ticket_create/", TicketCreateView.as_view(), name="ticket_create"),
  13. path("<int:pk>/delete", TicketListDeleteView.as_view(), name="ticket_list_delete"),
  14. path("ticket/<int:pk>/", TicketDetailView.as_view(), name="ticket_detail"),
  15. path("ticket/<int:pk>/edit", TicketEditView.as_view(), name="ticket_edit"),
  16. path("ticket/<int:pk>/delete", TicketDeleteView.as_view(), name="ticket_delete"),
  17. path("attachment/remove/<int:attachment_id>/", remove_attachment, name="remove_attachment"),
  18. # API
  19. path("api/ticket_list/", apiviews.TicketListListAPIView.as_view()),
  20. path("api/ticket_list/my/", apiviews.TicketListDetailAPIView.as_view(), {"my": True}),
  21. path("api/ticket_list/<int:pk>", apiviews.TicketListDetailAPIView.as_view()),
  22. path("api/ticket/", apiviews.TicketCreateAPIView.as_view()),
  23. path("api/ticket/<int:pk>", apiviews.TicketDetailAPIView.as_view()),
  24. path("api/ticket/<int:pk>/status", apiviews.TicketStatusAPIView.as_view()),
  25. ]