comparison gpp/comments/models.py @ 140:91a01b8b5885

Comments: in order to show a green board concept while looking at the comments in the admin, added a 'not removed' boolean function.
author Brian Neal <bgneal@gmail.com>
date Mon, 30 Nov 2009 03:20:24 +0000
parents 48621ba5c385
children 5c889b587416
comparison
equal deleted inserted replaced
139:e04d91babfcf 140:91a01b8b5885
65 return urlresolvers.reverse( 65 return urlresolvers.reverse(
66 "comments-url-redirect", 66 "comments-url-redirect",
67 args=(self.content_type_id, self.object_id) 67 args=(self.content_type_id, self.object_id)
68 ) 68 )
69 69
70 def not_removed(self):
71 """
72 Returns not self.is_removed. Used on the admin display for
73 "green board" display purposes.
74 """
75 return not self.is_removed
76 not_removed.boolean = True
77
70 78
71 class CommentFlag(models.Model): 79 class CommentFlag(models.Model):
72 """This model represents a user flagging a comment as inappropriate.""" 80 """This model represents a user flagging a comment as inappropriate."""
73 user = models.ForeignKey(User) 81 user = models.ForeignKey(User)
74 comment = models.ForeignKey(Comment) 82 comment = models.ForeignKey(Comment)