Mercurial > public > sg101
comparison gpp/weblinks/admin.py @ 398:701730b2fcda
Fixing #196; add status messages in the admin after approving news and links.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sat, 26 Mar 2011 00:26:00 +0000 |
parents | d424b8bae71d |
children |
comparison
equal
deleted
inserted
replaced
397:accfc1fdb88d | 398:701730b2fcda |
---|---|
31 hits=0, | 31 hits=0, |
32 is_public=True) | 32 is_public=True) |
33 link.save() | 33 link.save() |
34 pending_link.delete() | 34 pending_link.delete() |
35 | 35 |
36 count = len(qs) | |
37 msg = "1 link" if count == 1 else "%d links" % count | |
38 self.message_user(request, "%s approved." % msg) | |
39 | |
36 approve_links.short_description = "Approve selected links" | 40 approve_links.short_description = "Approve selected links" |
37 | 41 |
38 | 42 |
39 class LinkAdmin(admin.ModelAdmin): | 43 class LinkAdmin(admin.ModelAdmin): |
40 list_display = ('title', 'url', 'category', 'date_added', 'hits', 'is_public') | 44 list_display = ('title', 'url', 'category', 'date_added', 'hits', 'is_public') |