Ticket #8359: 8359choices.diff
File 8359choices.diff, 1.8 KB (added by , 16 years ago) |
---|
-
django/contrib/admin/models.py
9 9 ADDITION = 1 10 10 CHANGE = 2 11 11 DELETION = 3 12 LOG_ACTION_CHOICES = ( 13 ( ADDITION, "Added." ), 14 ( CHANGE, "Changed." ), 15 ( DELETION, "Deleted." ), 16 ) 12 17 13 18 class LogEntryManager(models.Manager): 14 19 def log_action(self, user_id, content_type_id, object_id, object_repr, action_flag, change_message=''): … … 21 26 content_type = models.ForeignKey(ContentType, blank=True, null=True) 22 27 object_id = models.TextField(_('object id'), blank=True, null=True) 23 28 object_repr = models.CharField(_('object repr'), max_length=200) 24 action_flag = models.PositiveSmallIntegerField(_('action flag') )29 action_flag = models.PositiveSmallIntegerField(_('action flag'),choices=LOG_ACTION_CHOICES) 25 30 change_message = models.TextField(_('change message'), blank=True) 26 31 objects = LogEntryManager() 27 32 class Meta: -
django/contrib/admin/templates/admin/object_history.html
23 23 <tr> 24 24 <th scope="row">{{ action.action_time|date:_("DATE_WITH_TIME_FULL") }}</th> 25 25 <td>{{ action.user.username }}{% if action.user.first_name %} ({{ action.user.first_name }} {{ action.user.last_name }}){% endif %}</td> 26 <td>{ { action.change_message }}</td>26 <td>{% if action.change_message %}{{ action.change_message }}{% else %}{{ action.get_action_flag_display }}{% endif %}</td> 27 27 </tr> 28 28 {% endfor %} 29 29 </tbody>