Show last person to act on a rrequest on dashboard
This commit is contained in:
parent
648be3ef83
commit
370bbe58af
|
@ -33,6 +33,14 @@ class Request(models.Model):
|
|||
def __str__(self):
|
||||
return "(%s -> %s) [%s] %s" % (self.applicant, self.provider, self.status, self.subject)
|
||||
|
||||
def getLastActionBy(self):
|
||||
msgs = self.requestmessage_set.order_by("-created")
|
||||
|
||||
if msgs.count() > 0:
|
||||
return msgs[0].creator
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
class RequestMessage(models.Model):
|
||||
request = models.ForeignKey(Request)
|
||||
|
|
|
@ -96,11 +96,13 @@
|
|||
<tr>
|
||||
<th>From</th>
|
||||
<th>Subject</th>
|
||||
<th>Last</th>
|
||||
</tr>
|
||||
{% for rrequest in rrequests %}
|
||||
<tr>
|
||||
<td>{{ rrequest.applicant }} <span class="glyphicon glyphicon-arrow-right"></span> {{ rrequest.provider }}</td>
|
||||
<td><a href="{{ rrequest.get_absolute_url }}">{{ rrequest.subject }}</a></td>
|
||||
<td>{{ rrequest.getLastActionBy }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
|
Loading…
Reference in New Issue