~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to wlscreens/admin.py

  • Committer: Holger Rapp
  • Date: 2009-04-11 15:21:15 UTC
  • Revision ID: rapp@mrt.uka.de-20090411152115-qpbnxxze99td19bz
Added a first version of a screenshot application

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python -tt
 
2
# encoding: utf-8
 
3
 
 
4
from models import Category, Screenshot
 
5
from django.contrib import admin
 
6
 
 
7
class CategoryAdmin(admin.ModelAdmin):
 
8
    prepopulated_fields = {'slug': ('name',)}
 
9
    search_fields = [ "name" ]
 
10
    list_display = ["name" ]
 
11
 
 
12
admin.site.register(Category, CategoryAdmin)
 
13
 
 
14
class ScreenshotAdmin(admin.ModelAdmin):
 
15
    search_fields = ["name"]
 
16
    list_filter = ["category"]
 
17
 
 
18
admin.site.register(Screenshot, ScreenshotAdmin)
 
19