123456789101112131415161718192021222324252627282930313233343536373839 |
- from django.urls import path, include
- from tickets.api import views as apiviews
- from tickets.views import *
- from tickets.api.v2.views.tickets import TicketPatchAPIView, TicketListAPIView
- app_name = "tickets"
- api_v1_patterns = [
- path("ticket_list/", apiviews.TicketListListAPIView.as_view()),
- path("ticket_list/my/", apiviews.TicketListDetailAPIView.as_view(), {"my": True}),
- path("ticket_list/<int:pk>", apiviews.TicketListDetailAPIView.as_view()),
- path("ticket/", apiviews.TicketCreateAPIView.as_view()),
- path("ticket/<int:pk>", apiviews.TicketDetailAPIView.as_view()),
- path("ticket/<int:pk>/status", apiviews.TicketStatusAPIView.as_view()),
- ]
- api_v2_patterns = [
- path('ticket/<int:pk>', TicketPatchAPIView.as_view()),
- path('ticket/', TicketListAPIView.as_view()),
- ]
- urlpatterns = [
- path("", TicketListView.as_view(), name="ticket_list_list"),
- path("search/", search, name="search"),
- path("my_tickets/", ticket_list_detail, {"my_tickets": True}, name="my_tickets"),
- path("assignments/", ticket_list_detail, {"assignments": True}, name="assignments"),
- path("<int:pk>/", ticket_list_detail, name="ticket_list_detail"),
- path("<int:pk>/ticket_create/", TicketCreateView.as_view(), name="ticket_create"),
- path("ticket/<int:pk>/", TicketDetailView.as_view(), name="ticket_detail"),
- path("ticket/<int:pk>/edit", TicketEditView.as_view(), name="ticket_edit"),
- path("ticket/<int:pk>/delete", TicketDeleteView.as_view(), name="ticket_delete"),
- path("attachment/remove/<int:attachment_id>/", remove_attachment, name="remove_attachment"),
- path("api/", include(api_v1_patterns)),
- path("api/v2/", include(api_v2_patterns)),
- ]
|