Skip to content

Instantly share code, notes, and snippets.

@jasongonzales23
Last active November 14, 2015 22:58
Show Gist options
  • Save jasongonzales23/75262eb81f82abb5d4e9 to your computer and use it in GitHub Desktop.
Save jasongonzales23/75262eb81f82abb5d4e9 to your computer and use it in GitHub Desktop.
suggestion
from django.shortcuts import render
from django.http import HttpResponse
from django.template import RequestContext, loader
from .models import Application
from django.shortcuts import get_object_or_404, render
#
def index(request):
application_list = Application.objects.order_by('-created_date')[:5]
context = {'application_list': application_list}
return render(request, 'applications/index.html', context)
#not working
def detail(request, application_id):
application = get_object_or_404(Application, pk=application_id)
return render(request, 'applications/detail.html', {'application':application})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment