Karaage-Cluster/karaage — Issue #130: application list doesn't display the application title
Author: sorrison
Created: 2012-02-15 22:54:59+00:00
State: open

I noticed while debugging issues with applications, that the application list doesn't display the type of the application, I think this would be very useful information to display.

I can think of either two solutions, the one that is the most efficient:

{{{
diff --git a/karaage/applications/templates/applications/application_table.html b/karaage/applications/templates/applications/application_table.html
index 09d1b81..f03c0a7 100644
--- a/karaage/applications/templates/applications/application_table.html
+++ b/karaage/applications/templates/applications/application_table.html
@@ -2,6 +2,7 @@

Details
+	Type
User
State

@@ -10,6 +11,7 @@
{% for app in object_list %}

{{ app.id }}
+	{{ app.type }}
{% if app.applicant.user %}
{{ app.applicant}}
{% else %}
}}}

While Application.type() is a simple function that just returns self._class

{{{
def type(self):
return self._class
}}}

Or the solution that is the most correct. Change the for loop in the above template to (not tested)

{{{
{% for app in object_list %}
{% with appobj=app.get_object %}
...
... {{ appobj.get_display_type }} ...
...
{% endwidth %}
{% endfor %}
}}}

which is way more flexible, but unfortunately requires an extra SQL query for every line displayed.

What are your thoughts?

Also where is the Application.get_state_display() function defined???