urls.py 1.4 KB

123456789101112131415161718192021222324252627282930
  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("my_tickets/", ticket_list_detail, {"my_tickets": True}, name="my_tickets"),
  9. path("assignments/", ticket_list_detail, {"assignments": True}, name="assignments"),
  10. path("<int:pk>/", ticket_list_detail, name="ticket_list_detail"),
  11. path("<int:pk>/ticket_create/", TicketCreateView.as_view(), name="ticket_create"),
  12. path("ticket/<int:pk>/", TicketDetailView.as_view(), name="ticket_detail"),
  13. path("ticket/<int:pk>/edit", TicketEditView.as_view(), name="ticket_edit"),
  14. path("ticket/<int:pk>/delete", TicketDeleteView.as_view(), name="ticket_delete"),
  15. path("attachment/remove/<int:attachment_id>/", remove_attachment, name="remove_attachment"),
  16. # API
  17. path("api/ticket_list/", apiviews.TicketListListAPIView.as_view()),
  18. path("api/ticket_list/my/", apiviews.TicketListDetailAPIView.as_view(), {"my": True}),
  19. path("api/ticket_list/<int:pk>", apiviews.TicketListDetailAPIView.as_view()),
  20. path("api/ticket/", apiviews.TicketCreateAPIView.as_view()),
  21. path("api/ticket/<int:pk>", apiviews.TicketDetailAPIView.as_view()),
  22. path("api/ticket/<int:pk>/status", apiviews.TicketStatusAPIView.as_view()),
  23. ]