annotate gpp/comments/admin.py @ 12:f408971657b9
Changed the shoutbox: posts are now made by Ajax. The smiley farm is loaded only on demand. jQuery is now in the base template. May add scrolling later.
author |
Brian Neal <bgneal@gmail.com> |
date |
Wed, 15 Apr 2009 01:13:17 +0000 |
parents |
dbd703f7d63a |
children |
777451a98f9d |
rev |
line source |
gremmie@1
|
1 """
|
gremmie@1
|
2 This file contains the automatic admin site definitions for the comment models.
|
gremmie@1
|
3 """
|
gremmie@1
|
4 from django.contrib import admin
|
gremmie@1
|
5 from comments.models import Comment
|
gremmie@1
|
6 from comments.models import CommentFlag
|
gremmie@1
|
7
|
gremmie@1
|
8 class CommentAdmin(admin.ModelAdmin):
|
gremmie@1
|
9 fieldsets = (
|
gremmie@1
|
10 (None,
|
gremmie@1
|
11 {'fields': ('content_type', 'object_id', )}
|
gremmie@1
|
12 ),
|
gremmie@1
|
13 ('Content',
|
gremmie@1
|
14 {'fields': ('user', 'comment')}
|
gremmie@1
|
15 ),
|
gremmie@1
|
16 ('Metadata',
|
gremmie@1
|
17 {'fields': ('ip_address', 'is_public', 'is_removed')}
|
gremmie@1
|
18 ),
|
gremmie@1
|
19 )
|
gremmie@1
|
20 list_display = ('__unicode__', 'content_type', 'object_id', 'ip_address', 'creation_date', 'is_public', 'is_removed')
|
gremmie@1
|
21 list_filter = ('creation_date', 'is_public', 'is_removed')
|
gremmie@1
|
22 date_hierarchy = 'creation_date'
|
gremmie@1
|
23 ordering = ('-creation_date', )
|
gremmie@1
|
24 search_fields = ('comment', 'user__username', 'ip_address')
|
gremmie@1
|
25 raw_id_fields = ('user', 'content_type')
|
gremmie@1
|
26
|
gremmie@1
|
27 class CommentFlagAdmin(admin.ModelAdmin):
|
gremmie@1
|
28 list_display = ('__unicode__', 'get_comment_url')
|
gremmie@1
|
29
|
gremmie@1
|
30 admin.site.register(Comment, CommentAdmin)
|
gremmie@1
|
31 admin.site.register(CommentFlag, CommentFlagAdmin)
|