Added created_on DateTime property to request.
As requested in Issue 302.
Patch by: Lennard de Rijk
Reviewed by: to-be-reviewed
--- a/app/soc/models/request.py Fri Mar 06 12:08:55 2009 +0000
+++ b/app/soc/models/request.py Fri Mar 06 15:23:22 2009 +0000
@@ -54,4 +54,5 @@
choices=['new', 'group_accepted', 'completed', 'rejected','ignored'])
status.help_text = ugettext('Shows the status of the request')
-
+ #: DateTime when the request was created
+ created_on = db.DateTimeProperty(auto_now_add=True)
--- a/app/soc/templates/soc/request/list/heading.html Fri Mar 06 12:08:55 2009 +0000
+++ b/app/soc/templates/soc/request/list/heading.html Fri Mar 06 15:23:22 2009 +0000
@@ -3,4 +3,5 @@
<th>Role</th>
<th>For</th>
<th>Status</th>
+ <th>Created On</th>
</tr>
--- a/app/soc/templates/soc/request/list/row.html Fri Mar 06 12:08:55 2009 +0000
+++ b/app/soc/templates/soc/request/list/row.html Fri Mar 06 15:23:22 2009 +0000
@@ -7,4 +7,5 @@
<td><div class="role">{{ list.item.role_verbose }}</div></td>
<td><div class="for">{{ list.item.scope_path }}</div></td>
<td><div class="status">{{ list.item.status }}</div></td>
+ <td><div class="created">{{ list.item.created_on|date:"jS F Y H:i" }}</div></td>
</tr>
--- a/app/soc/views/models/request.py Fri Mar 06 12:08:55 2009 +0000
+++ b/app/soc/views/models/request.py Fri Mar 06 15:23:22 2009 +0000
@@ -79,8 +79,8 @@
'list')]
new_params['create_template'] = ['soc/request/create.html']
-
- new_params['extra_dynaexclude'] = ['status', 'role_verbose']
+
+ new_params['extra_dynaexclude'] = ['status', 'role_verbose', 'created_on']
new_params['create_extra_dynaproperties'] = {
'link_id': widgets.ReferenceField(reference_url='user'),
@@ -100,7 +100,7 @@
'Process Invite to become')]
new_params['extra_django_patterns'] = patterns
-
+
new_params['invite_processing_template'] = 'soc/request/process_invite.html'
new_params['request_processing_template'] = \
'soc/request/process_request.html'