Properly order surveys on list
authorMagnus Hagander <magnus@hagander.net>
Tue, 16 Aug 2011 11:58:27 +0000 (13:58 +0200)
committerMagnus Hagander <magnus@hagander.net>
Tue, 16 Aug 2011 11:58:27 +0000 (13:58 +0200)
pgweb/survey/views.py

index 898170f8558b2223ddd27c192352db099265097b..93fa6ed35bd270ba878c128b268e5cd880fbb3b1 100644 (file)
@@ -9,7 +9,7 @@ from models import Survey, SurveyAnswer, SurveyLock
 
 def results(request, surveyid, junk=None):
        survey = get_object_or_404(Survey, pk=surveyid)
-       surveylist = Survey.objects.all()
+       surveylist = Survey.objects.all().order_by('-posted')
 
        return render_to_response('survey/results.html', {
                'survey': survey,