Ticket #5909: comments_model.diff
File comments_model.diff, 1.5 KB (added by , 17 years ago) |
---|
-
models.py
102 102 date_hierarchy = 'submit_date' 103 103 search_fields = ('comment', 'user__username') 104 104 105 def __ repr__(self):105 def __unicode__(self): 106 106 return "%s: %s..." % (self.user.username, self.comment[:100]) 107 107 108 108 def get_absolute_url(self): … … 190 190 date_hierarchy = 'submit_date' 191 191 search_fields = ('comment', 'person_name') 192 192 193 def __ repr__(self):193 def __unicode__(self): 194 194 return "%s: %s..." % (self.person_name, self.comment[:100]) 195 195 196 196 def get_absolute_url(self): … … 244 244 verbose_name_plural = _('karma scores') 245 245 unique_together = (('user', 'comment'),) 246 246 247 def __ repr__(self):247 def __unicode__(self): 248 248 return _("%(score)d rating by %(user)s") % {'score': self.score, 'user': self.user} 249 249 250 250 class UserFlagManager(models.Manager): … … 275 275 verbose_name_plural = _('user flags') 276 276 unique_together = (('user', 'comment'),) 277 277 278 def __ repr__(self):278 def __unicode__(self): 279 279 return _("Flag by %r") % self.user 280 280 281 281 class ModeratorDeletion(models.Model): … … 287 287 verbose_name_plural = _('moderator deletions') 288 288 unique_together = (('user', 'comment'),) 289 289 290 def __ repr__(self):290 def __unicode__(self): 291 291 return _("Moderator deletion by %r") % self.user