diff gpp/news/views.py @ 204:b4305e18d3af

Resolve ticket #74. Add user badges. Some extra credit was done here: also refactored how pending news, links, and downloads are handled.
author Brian Neal <bgneal@gmail.com>
date Sat, 01 May 2010 21:53:59 +0000
parents 2baadae33f2e
children da46e77cd804
line wrap: on
line diff
--- a/gpp/news/views.py	Wed Apr 28 03:00:31 2010 +0000
+++ b/gpp/news/views.py	Sat May 01 21:53:59 2010 +0000
@@ -57,7 +57,7 @@
 #######################################################################
 
 def archive_index(request):
-   dates = Story.objects.dates('date_published', 'month', order='DESC')
+   dates = Story.objects.dates('date_submitted', 'month', order='DESC')
    return render_to_response('news/archive_index.html', {
       'title': 'News Archive',
       'dates': dates, 
@@ -68,7 +68,7 @@
 #######################################################################
 
 def archive(request, year, month, page=1):
-   stories = Story.objects.filter(date_published__year=year, date_published__month=month)
+   stories = Story.objects.filter(date_submitted__year=year, date_submitted__month=month)
    paginator = create_paginator(stories)
    try:
       the_page = paginator.page(int(page))
@@ -144,7 +144,7 @@
    stories = stories.filter(
          Q(title__icontains=query_text) |
          Q(short_text__icontains=query_text) |
-         Q(long_text__icontains=query_text)).order_by('-date_published')
+         Q(long_text__icontains=query_text)).order_by('-date_submitted')
 
    paginator = create_paginator(stories)
    try: