Project model changes.
authorMadhusudan.C.S <madhusudancs@gmail.com>
Fri, 07 Aug 2009 03:56:08 +0530
changeset 16 bed14c9685a5
parent 15 8c9e6c98de82
child 17 5c1e26fa0fc4
Project model changes.
app/projrev/models.py
app/projrev/views/proposal.py
app/templates/projrev/proposal/rank.html
--- a/app/projrev/models.py	Fri Aug 07 03:40:08 2009 +0530
+++ b/app/projrev/models.py	Fri Aug 07 03:56:08 2009 +0530
@@ -67,6 +67,8 @@
                             choices=[('new', 'New'), ('pilot', 'Pilot'),
                                      ('invalid', 'Invalid')])
 
+  last_updated_on = models.DateTimeField(auto_now=True)
+
   @classmethod
   def getLineItem(cls, code):
     """Get the State name from its code.
--- a/app/projrev/views/proposal.py	Fri Aug 07 03:40:08 2009 +0530
+++ b/app/projrev/views/proposal.py	Fri Aug 07 03:56:08 2009 +0530
@@ -240,7 +240,8 @@
 
   if not micr_code:
     template = 'projrev/proposal/list.html'
-    context['projects'] = Project.objects.all().exclude(status__exact='invalid')
+    context['projects'] = Project.objects.all().exclude(
+        status__exact='invalid').order_by('-last_updated_on')
     context['row_url'] = '/proposal/review/'
 
     return render_to_response(template, RequestContext(request, context))
@@ -278,26 +279,12 @@
   """
   """
 
-  if request.method == 'POST':
-    return rankPost(request, micr_code)
-  else:
-    return rankGet(request, micr_code)
-
-def rankPost(request, micr_code=None):
-  """
-  """
-
-  return rankGet(request, micr_code)
-
-def rankGet(request, micr_code=None):
-  """
-  """
-
   context = {}
 
   if not micr_code:
     template = 'projrev/proposal/list.html'
-    context['projects'] = Project.objects.all()
+    context['projects'] = Project.objects.all().exclude(
+        status__exact='invalid').order_by('-last_updated_on')
     context['row_url'] = '/proposal/rank/'
 
     return render_to_response(template, RequestContext(request, context))
--- a/app/templates/projrev/proposal/rank.html	Fri Aug 07 03:40:08 2009 +0530
+++ b/app/templates/projrev/proposal/rank.html	Fri Aug 07 03:56:08 2009 +0530
@@ -128,7 +128,7 @@
       Overall Score:
     </div>
     <div class='review-right'>
-      {{ total_score }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+      {{ total_score }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       {{ total_avg }}
     </div>
   </p>