Skip to content

Views Reference

Version: Arctyk ITSM v0.6.0+
Last Updated: January 2026

Reference for Django views and mixins.


Ticket Views

TicketListView

Type: ListView
URL: /tickets/
Template: tickets/ticket_list.html
Context: tickets, page_obj, filter_form
Permissions: @login_required

Features:

  • Pagination (25 per page)
  • Filtering by status, priority, assignee, project
  • Search functionality
  • Sorting by multiple fields

TicketDetailView

Type: DetailView
URL: /tickets/<pk>/
Template: tickets/ticket_detail.html
Context: ticket, comments, history, available_transitions
Permissions: @login_required

Features (v0.6.0+):

  • Displays ticket details
  • Shows comment thread (public + internal based on permissions)
  • Displays change history
  • Available workflow transitions
  • SLA status indicators

TicketCreateView

Type: CreateView
URL: /tickets/create/
Template: tickets/ticket_form.html
Form: TicketForm
Permissions: @login_required

Behavior:

  • Auto-assigns ticket_number
  • Sets reporter to current user
  • Sends email notification on creation

TicketUpdateView

Type: UpdateView
URL: /tickets/<pk>/edit/
Template: tickets/ticket_form.html
Form: TicketForm
Permissions: @login_required

Behavior:

  • Validates workflow transitions
  • Updates lifecycle timestamps (first_responded_at, resolved_at, closed_at)
  • Logs changes to ChangeLog

Comment Views (v0.6.0+)

CommentCreateView

Type: AJAX View
URL: /tickets/<pk>/comments/add/
Method: POST
Response: JSON
Permissions: @login_required

Request Body:

{
  "content": "Comment text",
  "comment_type": "public" | "internal"
}

Response:

{
  "success": true,
  "comment": {
    "id": 123,
    "content": "...",
    "author": "John Doe",
    "created_at": "2026-01-03T10:00:00Z"
  }
}

CommentUpdateView

Type: AJAX View
URL: /tickets/<pk>/comments/<id>/edit/
Method: PATCH
Response: JSON
Permissions: @login_required + ownership check

Behavior:

  • Creates CommentEditHistory entry
  • Updates edited_at timestamp
  • Sets edited_by to current user

CommentDeleteView

Type: AJAX View
URL: /tickets/<pk>/comments/<id>/delete/
Method: DELETE
Response: JSON
Permissions: @login_required + ownership check

Behavior:

  • Soft delete (sets is_deleted=True)
  • Records deleted_by and deleted_at
  • Retains content for audit trail

Project Views

ProjectListView

Type: ListView
URL: /projects/
Template: projects/project_list.html
Context: projects, page_obj
Permissions: @login_required


ProjectDetailView

Type: DetailView
URL: /projects/<pk>/
Template: projects/project_detail.html
Context: project, tickets
Permissions: @login_required


Asset Views

AssetListView

Type: ListView
URL: /inventory/assets/
Template: inventory/asset_list.html
Permissions: @login_required, @staff_required


AssetDetailView

Type: DetailView
URL: /inventory/assets/<pk>/
Template: inventory/asset_detail.html
Context: asset, history, related_tickets
Permissions: @login_required, @staff_required


Mixins

LoginRequiredMixin

Purpose: Require authentication for view access
Usage: Inherit in class-based views


StaffRequiredMixin

Purpose: Require staff/admin permissions
Usage: Inherit in class-based views


AjaxResponseMixin

Purpose: Return JSON responses for AJAX requests
Usage: Inherit for AJAX endpoints