blechreiz-website/eventplanner/admin.py

20 lines
567 B
Python
Raw Normal View History

2013-06-02 21:26:10 +02:00
from django.contrib import admin
from eventplanner.models import Event, EventParticipation
class EventParticipationInline(admin.TabularInline):
model = EventParticipation
extra = 1
readonly_fields = ('musician',)
fields = ( 'musician', 'status', 'comment', )
has_add_permission = lambda self, req : False
has_delete_permission = lambda self, req, obj : False
template = "custom_tabular.html"
2013-06-02 21:26:10 +02:00
class EventAdmin(admin.ModelAdmin):
inlines = ( EventParticipationInline, )
admin.site.register( Event, EventAdmin )