~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to wlmaps/admin.py

  • Committer: Holger Rapp
  • Date: 2009-02-19 15:31:42 UTC
  • Revision ID: sirver@h566336-20090219153142-dc8xuabldnw5t395
Initial commit of new widelands homepage

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python -tt
2
 
# encoding: utf-8
3
 
#
4
 
 
5
 
from models import Map
6
 
from django.contrib import admin
7
 
 
8
 
 
9
 
class MapAdmin(admin.ModelAdmin):
10
 
    list_display = ['name', 'author', 'pub_date']
11
 
    prepopulated_fields = {'slug': ('name',)}
12
 
    search_fields = ['name', 'author']
13
 
    list_filter = ['pub_date']
14
 
    readonly_fields = ('uploader', 'nr_players', 'w', 'h', 'minimap', 'file', 'world_name')
15
 
    fieldsets = (
16
 
        (None, {
17
 
            'fields': (('name', 'author'), 'uploader', 'uploader_comment')
18
 
        }),
19
 
        ('Map properties', {
20
 
            'classes': ('collapse',),
21
 
            'fields': ('descr', 'hint', 'world_name',
22
 
                       ('nr_players', 'w', 'h')
23
 
                       )
24
 
        }),
25
 
        ('Upload information', {
26
 
            'classes': ('collapse',),
27
 
            'fields': ('minimap', 'file', 'pub_date', 'nr_downloads', 'slug')
28
 
        }),
29
 
    )
30
 
admin.site.register(Map, MapAdmin)