~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to check_input/admin.py

  • Committer: Holger Rapp
  • Date: 2009-02-21 18:24:02 UTC
  • Revision ID: sirver@kallisto.local-20090221182402-k3tuf5c4gjwslbjf
Main Page contains now the same informations as before

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
from check_input.models import SuspiciousInput
2
 
from django.contrib import admin
3
 
from django.contrib.contenttypes.models import ContentType
4
 
 
5
 
 
6
 
class SuspiciousInputAdmin(admin.ModelAdmin):
7
 
    list_display = ('text', 'user', 'get_app')
8
 
    readonly_fields = ('text', 'user', 'get_app',)
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
 
 
18
 
admin.site.register(SuspiciousInput, SuspiciousInputAdmin)