~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to threadedcomments/admin.py

  • Committer: franku
  • Date: 2016-05-15 14:41:54 UTC
  • mto: This revision was merged to the branch mainline in revision 409.
  • Revision ID: somal@arcor.de-20160515144154-00m3tiibyxm0nw2w
added the old threadedcomments app as wildelands app

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from django.contrib import admin
 
2
from django.utils.translation import ugettext_lazy as _
 
3
from threadedcomments.models import ThreadedComment, FreeThreadedComment
 
4
 
 
5
class ThreadedCommentAdmin(admin.ModelAdmin):
 
6
    fieldsets = (
 
7
        (None, {'fields': ('content_type', 'object_id')}),
 
8
        (_('Parent'), {'fields' : ('parent',)}),
 
9
        (_('Content'), {'fields': ('user', 'comment')}),
 
10
        (_('Meta'), {'fields': ('is_public', 'date_submitted', 'date_modified', 'date_approved', 'is_approved', 'ip_address')}),
 
11
    )
 
12
    list_display = ('user', 'date_submitted', 'content_type', 'get_content_object', 'parent', '__unicode__')
 
13
    list_filter = ('date_submitted',)
 
14
    date_hierarchy = 'date_submitted'
 
15
    search_fields = ('comment', 'user__username')
 
16
 
 
17
class FreeThreadedCommentAdmin(admin.ModelAdmin):
 
18
    fieldsets = (
 
19
        (None, {'fields': ('content_type', 'object_id')}),
 
20
        (_('Parent'), {'fields' : ('parent',)}),
 
21
        (_('Content'), {'fields': ('name', 'website', 'email', 'comment')}),
 
22
        (_('Meta'), {'fields': ('date_submitted', 'date_modified', 'date_approved', 'is_public', 'ip_address', 'is_approved')}),
 
23
    )
 
24
    list_display = ('name', 'date_submitted', 'content_type', 'get_content_object', 'parent', '__unicode__')
 
25
    list_filter = ('date_submitted',)
 
26
    date_hierarchy = 'date_submitted'
 
27
    search_fields = ('comment', 'name', 'email', 'website')
 
28
 
 
29
 
 
30
admin.site.register(ThreadedComment, ThreadedCommentAdmin)
 
31
admin.site.register(FreeThreadedComment, FreeThreadedCommentAdmin)