feat: created first ticket class

This commit is contained in:
2025-05-03 00:46:47 +02:00
parent 3fe2151588
commit b8b9443d8a
6 changed files with 57 additions and 9 deletions

View File

@@ -1,3 +1,12 @@
from django.shortcuts import render
from django.http import HttpResponse
from .models import Ticket
# Create your views here.
def index(request):
latest_ticket_list = Ticket.objects.order_by("-created_at")[:5]
output = ", ".join([t.title for t in latest_ticket_list])
return HttpResponse(output)
def detail(request, ticket_id):
return HttpResponse("You're looking at Ticket %s." % ticket_id)