Initial commit
This commit is contained in:
28
tipp/admin.py
Normal file
28
tipp/admin.py
Normal file
@@ -0,0 +1,28 @@
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user