feat: created first ticket class
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user