Added created and last modified timestamps to the group_app model.
authorLennard de Rijk <ljvderijk@gmail.com>
Wed, 21 Jan 2009 18:50:22 +0000
changeset 881 1ad41c8d05e9
parent 880 d67557c612de
child 882 267e31f1a0b6
Added created and last modified timestamps to the group_app model. Also edited the templates to show some extra information. The review template has the names for the new properties hard coded because the auto_add and auto_add_now datetimeproperties don't show up in the fields of the entity. Patch by: Lennard de Rijk
app/soc/models/group_app.py
app/soc/templates/soc/club_app/list/heading.html
app/soc/templates/soc/club_app/list/row.html
app/soc/templates/soc/club_app/review.html
--- a/app/soc/models/group_app.py	Wed Jan 21 18:25:37 2009 +0000
+++ b/app/soc/models/group_app.py	Wed Jan 21 18:50:22 2009 +0000
@@ -110,3 +110,12 @@
   # handled and turned into a group
   application_completed = db.BooleanProperty(required=True, default=False,
       verbose_name=ugettext_lazy('Has been completed'))
+  
+  # timestamp to record the time on which this application has been created
+  created_on = db.DateTimeProperty(required=True, auto_now_add=True,
+      verbose_name=ugettext_lazy('Created on'))
+  
+  # timestamp to record the time on which this application has been last modified
+  # also changes when the review properties change
+  last_modified_on = db.DateTimeProperty(required=True, auto_now=True,
+      verbose_name=ugettext_lazy('Last modified on'))
--- a/app/soc/templates/soc/club_app/list/heading.html	Wed Jan 21 18:25:37 2009 +0000
+++ b/app/soc/templates/soc/club_app/list/heading.html	Wed Jan 21 18:50:22 2009 +0000
@@ -1,4 +1,5 @@
 <tr align="left">
   <th class="first" align="right">Name</th>
   <th>Link ID</th>
+  <th>Last Modified on</th>
 </tr>
--- a/app/soc/templates/soc/club_app/list/row.html	Wed Jan 21 18:25:37 2009 +0000
+++ b/app/soc/templates/soc/club_app/list/row.html	Wed Jan 21 18:50:22 2009 +0000
@@ -5,4 +5,5 @@
      </div>
   </td>
   <td><div class="link_id">{{ list.item.link_id }}</a></div></td>
+  <td><div class="date">{{ list.item.last_modified_on }}</a></div></td>
 </tr>
--- a/app/soc/templates/soc/club_app/review.html	Wed Jan 21 18:25:37 2009 +0000
+++ b/app/soc/templates/soc/club_app/review.html	Wed Jan 21 18:50:22 2009 +0000
@@ -31,9 +31,11 @@
   {% readonly_field_as_twoline_table_row entity.fields.irc_channel.label entity.irc_channel %}
   {% readonly_field_as_twoline_table_row entity.fields.backup_admin.label entity.backup_admin.link_id %}
   {% readonly_field_as_twoline_table_row entity.fields.member_criteria.label entity.member_criteria %}
-  {% readonly_field_as_twoline_table_row entity.fields.reviewed.label entity.reviewed %}
-  {% readonly_field_as_twoline_table_row entity.fields.accepted.label entity.accepted %}
-  {% readonly_field_as_twoline_table_row entity.fields.application_completed.label entity.application_completed %}
+  {% readonly_field_as_table_row entity.fields.reviewed.label entity.reviewed %}
+  {% readonly_field_as_table_row entity.fields.accepted.label entity.accepted %}
+  {% readonly_field_as_table_row entity.fields.application_completed.label entity.application_completed %}
+  {% readonly_field_as_table_row "Created on" entity.created_on %}
+  {% readonly_field_as_table_row "Last Modified on" entity.last_modified_on %}
  </table>
 </p>