# HG changeset patch # User Brian Neal # Date 1259551224 0 # Node ID 91a01b8b5885f94a1ecc7ab0a53f55120022403c # Parent e04d91babfcfd13e182e237e279e985bb2fd8794 Comments: in order to show a green board concept while looking at the comments in the admin, added a 'not removed' boolean function. diff -r e04d91babfcf -r 91a01b8b5885 gpp/comments/admin.py --- a/gpp/comments/admin.py Sun Nov 29 22:33:15 2009 +0000 +++ b/gpp/comments/admin.py Mon Nov 30 03:20:24 2009 +0000 @@ -17,7 +17,8 @@ {'fields': ('ip_address', 'is_public', 'is_removed')} ), ) - list_display = ('__unicode__', 'content_type', 'object_id', 'ip_address', 'creation_date', 'is_public', 'is_removed') + list_display = ('__unicode__', 'content_type', 'object_id', 'ip_address', + 'creation_date', 'is_public', 'not_removed') list_filter = ('creation_date', 'is_public', 'is_removed') date_hierarchy = 'creation_date' ordering = ('-creation_date', ) diff -r e04d91babfcf -r 91a01b8b5885 gpp/comments/models.py --- a/gpp/comments/models.py Sun Nov 29 22:33:15 2009 +0000 +++ b/gpp/comments/models.py Mon Nov 30 03:20:24 2009 +0000 @@ -67,6 +67,14 @@ args=(self.content_type_id, self.object_id) ) + def not_removed(self): + """ + Returns not self.is_removed. Used on the admin display for + "green board" display purposes. + """ + return not self.is_removed + not_removed.boolean = True + class CommentFlag(models.Model): """This model represents a user flagging a comment as inappropriate."""