From aba098c5c01793a4497b5706215c84b6b16974ba Mon Sep 17 00:00:00 2001 From: luxagraf Date: Wed, 24 Apr 2013 08:22:20 -0400 Subject: updated for django 1.5, removed grappelli dependency --- app/projects/views.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'app/projects') diff --git a/app/projects/views.py b/app/projects/views.py index 90db6ba..e9c755f 100644 --- a/app/projects/views.py +++ b/app/projects/views.py @@ -1,6 +1,5 @@ from django.shortcuts import render_to_response,get_object_or_404 from django.template import RequestContext -from django.views.generic.list_detail import object_list from django.db.models import get_model from django.http import HttpResponse from django.core import serializers @@ -10,7 +9,7 @@ from projects.models.base import Project from projects.models.fiveby import FiveBy from projects.models.natparks import NationalParks from projects.models.gifs import AnimatedGif -from projects.models.code import CodeBlogEntry + projects = {'5x5':'FiveBy','6x6':'SixBy','national-parks':'NationalParks','code':'Code'} """ @@ -23,18 +22,17 @@ def detail(request,slug): qs = model.objects.filter(visited__exact=True).order_by("-date_visited_begin") else: qs = model.objects.filter(status__exact=1) + context = { + "object_list" : qs, + } template = 'details/%s.html' %(slug) - return object_list(request, queryset=qs, template_name=template,) + return render_to_response(template, context, context_instance = RequestContext(request)) + def gif_detail(request,slug): obj = get_object_or_404(AnimatedGif, slug__exact=slug) return render_to_response('details/gifs.html', {'object': obj}, context_instance=RequestContext(request)) -def code_entry_detail(request, year, month, day, slug): - obj = get_object_or_404(CodeBlogEntry, slug__exact=slug) - return render_to_response('details/code_blog.html', {'object': obj}, context_instance=RequestContext(request)) - - def data_json(request, id): qs = NationalParks.objects.filter(pk=id) -- cgit v1.2.3-70-g09d2