Last active
November 14, 2015 22:58
-
-
Save jasongonzales23/75262eb81f82abb5d4e9 to your computer and use it in GitHub Desktop.
suggestion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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