~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to threadedcomments/admin.py

  • Committer: Holger Rapp
  • Date: 2019-06-21 18:34:42 UTC
  • mfrom: (540.1.3 update_ops_script)
  • Revision ID: sirver@gmx.de-20190621183442-y2ulybzr0rdvfefd
Adapt the update script for the new server.

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
 
4
 
 
5
 
 
6
class ThreadedCommentAdmin(admin.ModelAdmin):
 
7
    fieldsets = (
 
8
        (None, {'fields': ('content_type', 'object_id')}),
 
9
        (_('Parent'), {'fields': ('parent',)}),
 
10
        (_('Content'), {'fields': ('user', 'comment')}),
 
11
        (_('Meta'), {'fields': ('is_public', 'date_submitted',
 
12
                                'date_modified', 'date_approved', 'is_approved')}),
 
13
    )
 
14
    list_display = ('user', 'date_submitted', 'content_type',
 
15
                    'get_content_object', 'parent', '__str__')
 
16
    list_filter = ('date_submitted',)
 
17
    date_hierarchy = 'date_submitted'
 
18
    search_fields = ('comment', 'user__username')
 
19
 
 
20
 
 
21
admin.site.register(ThreadedComment, ThreadedCommentAdmin)