Skip to content

Commit

Permalink
Fixed 2 misnamed template references and abstracted 2 urls, refs #3
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/brian/Backups/S3/backups/Wednesday/brian/svn/djog/trunk@41 95ab7de8-677b-4562-a266-b8acc9dd993c
  • Loading branch information
alex committed Oct 18, 2007
1 parent a1a41e2 commit 0a7dde2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions djog/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

from django.core import urlresolvers
from django.contrib.comments.views.comments import post_free_comment
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
Expand All @@ -10,22 +11,22 @@ def post_free_comment_redirect(request):
if request.POST.has_key('url'):
url = request.POST['url']
else:
url = '/blog/'
url = urlresolvers.reverse('djog_index')
response = post_free_comment(request)
return HttpResponseRedirect(url)

def EntriesByTag(request, slug):
tag = Tag.objects.get(slug=slug)
entries = Entry.objects.filter(tags__slug=slug)
return render_to_response('blog/tag_list.html', {'entries': entries, 'tag': tag})
return render_to_response('djog/tag_list.html', {'entries': entries, 'tag': tag})

def Search(request):
if not request.GET.has_key('s'):
return HttpResponseRedirect('/blog/')
return HttpResponseRedirect(urlresolvers.reverse('djog_index'))
search = smart_str(request.GET['s'])
all = Entry.objects.filter(Q(title__icontains=search) | Q(text__icontains=search))

return render_to_response('blog/search.html', {'term': search, 'results': all})
return render_to_response('djog/search.html', {'term': search, 'results': all})

def trackback(request, id):
if request.method != 'POST':
Expand Down

0 comments on commit 0a7dde2

Please sign in to comment.