13 lines
350 B
Python
13 lines
350 B
Python
from django.http import HttpResponse
|
|
from .models import Ticket
|
|
|
|
|
|
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)
|