~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to threadedcomments/admin.py

  • Committer: franku
  • Date: 2018-10-03 09:01:09 UTC
  • mto: This revision was merged to the branch mainline in revision 502.
  • Revision ID: somal@arcor.de-20181003090109-so4zn8x9vujarq6n
removed IPAddressField from pybb

Show diffs side-by-side

added added

removed removed

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