Ticket #5909: comments_model.diff

File comments_model.diff, 1.5 KB (added by prairiedogg, 17 years ago)

diff file for my patch

  • models.py

     
    102102        date_hierarchy = 'submit_date'
    103103        search_fields = ('comment', 'user__username')
    104104
    105     def __repr__(self):
     105    def __unicode__(self):
    106106        return "%s: %s..." % (self.user.username, self.comment[:100])
    107107
    108108    def get_absolute_url(self):
     
    190190        date_hierarchy = 'submit_date'
    191191        search_fields = ('comment', 'person_name')
    192192
    193     def __repr__(self):
     193    def __unicode__(self):
    194194        return "%s: %s..." % (self.person_name, self.comment[:100])
    195195
    196196    def get_absolute_url(self):
     
    244244        verbose_name_plural = _('karma scores')
    245245        unique_together = (('user', 'comment'),)
    246246
    247     def __repr__(self):
     247    def __unicode__(self):
    248248        return _("%(score)d rating by %(user)s") % {'score': self.score, 'user': self.user}
    249249
    250250class UserFlagManager(models.Manager):
     
    275275        verbose_name_plural = _('user flags')
    276276        unique_together = (('user', 'comment'),)
    277277
    278     def __repr__(self):
     278    def __unicode__(self):
    279279        return _("Flag by %r") % self.user
    280280
    281281class ModeratorDeletion(models.Model):
     
    287287        verbose_name_plural = _('moderator deletions')
    288288        unique_together = (('user', 'comment'),)
    289289
    290     def __repr__(self):
     290    def __unicode__(self):
    291291        return _("Moderator deletion by %r") % self.user
Back to Top