# HG changeset patch # User nishanth # Date 1267707655 -19800 # Node ID fa1da06d25c9d5dc8618c6cc06a3cdf1c2efb14d # Parent 4774f6875a2df29c4ccbd378bee85329cf5a76fc now claims are read from notifications. we can ditchax claims model now. diff -r 4774f6875a2d -r fa1da06d25c9 taskapp/models.py --- a/taskapp/models.py Thu Mar 04 17:56:31 2010 +0530 +++ b/taskapp/models.py Thu Mar 04 18:30:55 2010 +0530 @@ -163,7 +163,7 @@ 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 -r 4774f6875a2d -r fa1da06d25c9 taskapp/views/task.py --- a/taskapp/views/task.py Thu Mar 04 17:56:31 2010 +0530 +++ b/taskapp/views/task.py Thu Mar 04 18:30:55 2010 +0530 @@ -342,7 +342,10 @@ 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 -r 4774f6875a2d -r fa1da06d25c9 templates/task/claim.html --- a/templates/task/claim.html Thu Mar 04 17:56:31 2010 +0530 +++ b/templates/task/claim.html Thu Mar 04 18:30:55 2010 +0530 @@ -7,9 +7,9 @@ List of all the claims for the task {{task.title}}
{% for claim in claims %}
- {{claim.user.username}} - on {{claim.creation_datetime|date:"D d M Y"}} at {{claim.creation_datetime|time:"H:i"}} wrote:
- {{claim.message}}
+ {{claim.sent_from.username}} + on {{claim.sent_date|date:"D d M Y"}} at {{claim.sent_date|time:"H:i"}} wrote:
+ {{claim.remarks}}
{% endfor %} {% else %} {% if task_claimable %}