added the field remarks in request model.
authornishanth
Thu, 25 Feb 2010 23:49:38 +0530
changeset 104 d1bdd5d6c1a6
parent 103 3a4c8fccb9f3
child 105 091b044a3bf4
added the field remarks in request model.
taskapp/models.py
taskapp/views/user.py
templates/user/view_request.html
--- a/taskapp/models.py	Thu Feb 25 20:13:59 2010 +0530
+++ b/taskapp/models.py	Thu Feb 25 23:49:38 2010 +0530
@@ -137,6 +137,7 @@
     sent_by = models.ForeignKey(User, related_name = "%(class)s_sent_by", blank = False)
     role = models.CharField(max_length = 2, blank = False)
     reply = models.BooleanField(default = False)
+    remarks = models.TextField(default = "",blank = True)
     is_read = models.BooleanField(default = False)
     creation_date = models.DateTimeField()
     reply_date = models.DateTimeField()
--- a/taskapp/views/user.py	Thu Feb 25 20:13:59 2010 +0530
+++ b/taskapp/views/user.py	Thu Feb 25 23:49:38 2010 +0530
@@ -148,6 +148,9 @@
         reqs = user.request_sent_to.filter(is_replied=False).order_by('creation_date')
         req_obj = reqs[int(rid)]
         reply = True if reply == "yes" else False
+        req_obj.remarks = request.POST.get('remarks', "")
+        req_obj.save()
+
         reply_to_request(req_obj, reply, user)
         
         return show_msg("Your reply has been processed", browse_request_url, "view other requests")
--- a/templates/user/view_request.html	Thu Feb 25 20:13:59 2010 +0530
+++ b/templates/user/view_request.html	Thu Feb 25 23:49:38 2010 +0530
@@ -19,6 +19,7 @@
         <input value="Yes" type="submit">
     </form>
     <form action="no/" method="post">
+        Remarks: <input type="text" name="remarks">
         <input value="No" type="submit">
     </form>
     <a href="/user/requests/">Click here</a> to return to the requests page.