~widelands-dev/widelands-website/trunk

476.1.6 by franku
refactoring of variables; moved spam_check into the model
1
from check_input.models import SuspiciousInput
476.1.3 by franku
forgot to add the admin page
2
from django.contrib import admin
476.1.4 by franku
more work on the admin page; fixed a failure in pybb
3
from django.contrib.contenttypes.models import ContentType
4
5
476.1.6 by franku
refactoring of variables; moved spam_check into the model
6
class SuspiciousInputAdmin(admin.ModelAdmin):
7
    list_display = ('text', 'user', 'get_app')
476.1.7 by franku
adjusted moderating view; minor fixes
8
    readonly_fields = ('text', 'user', 'get_app',)
476.1.4 by franku
more work on the admin page; fixed a failure in pybb
9
    exclude = ('content_type', 'object_id', )
10
    
11
    def get_app(self, obj):
12
        app = ContentType.objects.get_for_id(
13
            obj.content_type_id)
14
15
        return '%s/%s' % (app.app_label, app.name)
16
    get_app.short_description = 'Found in App/Model'
17
476.1.6 by franku
refactoring of variables; moved spam_check into the model
18
admin.site.register(SuspiciousInput, SuspiciousInputAdmin)