added attribute pynts to request model.
authoranoop
Wed, 24 Feb 2010 17:11:59 +0530
changeset 80 8917b190c4c4
parent 79 fd6b28204fb1
child 81 cade14d25a58
child 83 fd2e1bd7af82
added attribute pynts to request model.
taskapp/models.py
taskapp/utilities/request.py
--- a/taskapp/models.py	Wed Feb 24 16:52:03 2010 +0530
+++ b/taskapp/models.py	Wed Feb 24 17:11:59 2010 +0530
@@ -141,6 +141,7 @@
     replied = models.BooleanField(default = False)
     task = models.ForeignKey(Task,related_name = "%(class)s_task", blank = True, null = True)
     assigned_user = models.ForeignKey(User, related_name = "%(class)s_assigned_user", blank = True, null = True)
+    pynts = models.PositiveIntegerField(default=0)
 
 class Notification(models.Model):
 
--- a/taskapp/utilities/request.py	Wed Feb 24 16:52:03 2010 +0530
+++ b/taskapp/utilities/request.py	Wed Feb 24 17:11:59 2010 +0530
@@ -16,9 +16,9 @@
     req.save()
     req.to = to
     req.role = role
-    if task is not None:
+    if task:
         req.task = task
-    if assigned_user is not None:
+    if assigned_user:
         req.assigned_user = assigned_user
     req.save()
 
@@ -33,7 +33,7 @@
         request = Request.objects.get(id = request_id)
     except Request.DoesNotExist:
         return False #No such request exist
-    if request.replied is not True:
+    if not request.replied:
         request.reply = reply
         request.replied = True
         request.read = True