Files
TipPy/tipp/admin.py
2016-01-20 16:56:31 +01:00

29 lines
964 B
Python

from tipp.models import Team, Match, Tipp, Score, Mandant, RelUserMandant, Competition, Post, UserProfile
from django.contrib import admin
class PostAdmin(admin.ModelAdmin):
# fields display on change list
list_display = ['title']
# fields to filter the change list with
list_filter = ['published', 'created']
# fields to search in change list
search_fields = ['title', 'content']
# enable the date drill down on change list
date_hierarchy = 'created'
# enable the save buttons on top on change form
save_on_top = True
# prepopulate the slug from the title - big timesaver!
prepopulated_fields = {"slug": ("title",)}
admin.site.register(Team)
admin.site.register(Match)
admin.site.register(Tipp)
admin.site.register(Mandant)
admin.site.register(Score)
admin.site.register(RelUserMandant)
admin.site.register(Competition)
admin.site.register(Post, PostAdmin)