Ticket #15661: django-logentry-unicode.diff

File django-logentry-unicode.diff, 780 bytes (added by Keryn Knight <keryn@…>, 14 years ago)

svn diff against revision 15894

  • django/contrib/admin/models.py

     
    3333    def __repr__(self):
    3434        return smart_unicode(self.action_time)
    3535
     36    def __unicode__(self):
     37        action_output = {
     38            ADDITION: _('Added "%(object)s".') % {'object': self.object_repr},
     39            CHANGE: _('Changed "%(object)s" - %(changes)s') % {'object': self.object_repr, 'changes': self.change_message},
     40            DELETION: _('Deleted "%(object)s."') % {'object': self.object_repr},
     41        }
     42        return action_output[self.action_flag]
     43
    3644    def is_addition(self):
    3745        return self.action_flag == ADDITION
    3846
Back to Top