From ef977c0fe6d1c089f1db0e43fed3136776460810 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Fri, 14 Jan 2011 10:45:45 +0000 Subject: [PATCH] Show the last action date and user on the application list --- hr/models.py | 6 ++++++ templates/hr/applications/admin/view_list.html | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/hr/models.py b/hr/models.py index 42faf00..46e6b88 100644 --- a/hr/models.py +++ b/hr/models.py @@ -77,6 +77,12 @@ class Application(models.Model): return blacklist + @property + def last_action(self): + if self.audit_set.count(): + return self.audit_set.all().order_by('-date')[0] + return None + def save(self, *args, **kwargs): user = None diff --git a/templates/hr/applications/admin/view_list.html b/templates/hr/applications/admin/view_list.html index 8fa8f24..94afc07 100644 --- a/templates/hr/applications/admin/view_list.html +++ b/templates/hr/applications/admin/view_list.html @@ -15,12 +15,16 @@ Application ID Character Corporation - Application Status + Application Status + Last Action Date + Last Action User {% for app in apps %} {{ app.id }} {{ app.character }} {{ app.corporation }} {{ app.get_status_display }} + {{ app.last_action.date }} + {{ app.last_action.user }} {% endfor %}