summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornishanth2010-03-04 18:30:55 +0530
committernishanth2010-03-04 18:30:55 +0530
commitf1d2f36818c7033aaff55767a9413d654f68a4c8 (patch)
treed2bb7e0752cdd1c3da0cbe33f362199e63ba2cf6
parent6e665479f40b383725cf7979aebd79a1388808c1 (diff)
downloadpytask-f1d2f36818c7033aaff55767a9413d654f68a4c8.tar.gz
pytask-f1d2f36818c7033aaff55767a9413d654f68a4c8.tar.bz2
pytask-f1d2f36818c7033aaff55767a9413d654f68a4c8.zip
now claims are read from notifications. we can ditchax claims model now.
-rw-r--r--taskapp/models.py2
-rw-r--r--taskapp/views/task.py5
-rw-r--r--templates/task/claim.html6
3 files changed, 8 insertions, 5 deletions
diff --git a/taskapp/models.py b/taskapp/models.py
index 2282967..e4607c8 100644
--- a/taskapp/models.py
+++ b/taskapp/models.py
@@ -163,7 +163,7 @@ class Notification(models.Model):
role = models.CharField(max_length = 2, choices = NOTIFY_CHOICES, blank = False)
sent_to = models.ForeignKey(User, related_name = "%(class)s_sent_to", blank = False)
sent_from = models.ForeignKey(User, related_name = "%(class)s_sent_from", null = True, blank = True)
- task = models.ForeignKey(Task, related_name = "%(class)s_sent_for", null = True, blank = True)
+ task = models.ForeignKey(Task, related_name = "%(class)s_task", null = True, blank = True)
sub = models.CharField(max_length = 100)
message = models.TextField()
diff --git a/taskapp/views/task.py b/taskapp/views/task.py
index 5e5cb13..4f8b6c4 100644
--- a/taskapp/views/task.py
+++ b/taskapp/views/task.py
@@ -342,7 +342,10 @@ def claim_task(request, tid):
user = get_user(request.user) if request.user.is_authenticated() else request.user
task = getTask(tid)
- claims = Claim.objects.filter(task=task)
+ #claims = Claim.objects.filter(task=task)
+ #claims = task.notifications_task.filter(role="CL",sent_to=task.created_by)
+ # this is what the next line should be when i re sync the db
+ claims = Notification.objects.filter(task=task, sent_to=task.created_by, role="CL")
mentors = task.mentors.all()
claimed_users = task.claimed_users.all()
diff --git a/templates/task/claim.html b/templates/task/claim.html
index 428e0f4..d069bb6 100644
--- a/templates/task/claim.html
+++ b/templates/task/claim.html
@@ -7,9 +7,9 @@
List of all the claims for the task <a href="/task/view/tid={{task.id}}">{{task.title}}</a><br />
{% for claim in claims %}
<hr />
- <a href="/user/view/uid={{claim.user.id}}">{{claim.user.username}}</a>
- on {{claim.creation_datetime|date:"D d M Y"}} at {{claim.creation_datetime|time:"H:i"}} wrote:<br />
- {{claim.message}}<br />
+ <a href="/user/view/uid={{claim.sent_from.id}}">{{claim.sent_from.username}}</a>
+ on {{claim.sent_date|date:"D d M Y"}} at {{claim.sent_date|time:"H:i"}} wrote:<br />
+ {{claim.remarks}}<br />
{% endfor %}
{% else %}
{% if task_claimable %}