2016-07-13 17:13:47 +00:00
|
|
|
from django.contrib import admin
|
|
|
|
|
2017-04-16 00:10:24 +00:00
|
|
|
from .models import Event, Speaker, EventType, EventInstance, EventLocation, SpeakerProposal, EventProposal, Favorite
|
2017-03-12 14:43:41 +00:00
|
|
|
|
|
|
|
|
2017-03-12 18:06:03 +00:00
|
|
|
@admin.register(SpeakerProposal)
|
|
|
|
class SpeakerProposalAdmin(admin.ModelAdmin):
|
2017-03-15 23:30:59 +00:00
|
|
|
def mark_speakerproposal_as_approved(self, request, queryset):
|
|
|
|
for sp in queryset:
|
|
|
|
sp.mark_as_approved()
|
|
|
|
mark_speakerproposal_as_approved.description = 'Approve and create Speaker object(s)'
|
|
|
|
|
|
|
|
actions = ['mark_speakerproposal_as_approved']
|
2017-03-12 14:43:41 +00:00
|
|
|
|
|
|
|
|
2017-03-12 18:06:03 +00:00
|
|
|
@admin.register(EventProposal)
|
|
|
|
class EventProposalAdmin(admin.ModelAdmin):
|
2017-03-15 23:30:59 +00:00
|
|
|
def mark_eventproposal_as_approved(self, request, queryset):
|
|
|
|
for ep in queryset:
|
|
|
|
ep.mark_as_approved()
|
|
|
|
mark_eventproposal_as_approved.description = 'Approve and create Event object(s)'
|
|
|
|
|
|
|
|
actions = ['mark_eventproposal_as_approved']
|
2017-02-16 20:03:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
@admin.register(EventLocation)
|
2017-02-21 14:59:38 +00:00
|
|
|
class EventLocationAdmin(admin.ModelAdmin):
|
2017-02-16 20:03:24 +00:00
|
|
|
pass
|
2016-07-13 19:44:09 +00:00
|
|
|
|
|
|
|
|
2017-01-22 11:59:57 +00:00
|
|
|
@admin.register(EventInstance)
|
|
|
|
class EventInstanceAdmin(admin.ModelAdmin):
|
|
|
|
pass
|
|
|
|
|
2017-02-16 20:03:24 +00:00
|
|
|
|
2016-07-13 19:44:09 +00:00
|
|
|
@admin.register(EventType)
|
|
|
|
class EventTypeAdmin(admin.ModelAdmin):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2016-08-04 21:03:39 +00:00
|
|
|
@admin.register(Speaker)
|
|
|
|
class SpeakerAdmin(admin.ModelAdmin):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2017-04-16 00:10:24 +00:00
|
|
|
@admin.register(Favorite)
|
|
|
|
class FavoriteAdmin(admin.ModelAdmin):
|
|
|
|
raw_id_fields = ('event_instance',)
|
|
|
|
|
|
|
|
|
2016-08-04 21:03:39 +00:00
|
|
|
class SpeakerInline(admin.StackedInline):
|
|
|
|
model = Speaker.events.through
|
|
|
|
|
|
|
|
|
2016-07-13 19:44:09 +00:00
|
|
|
@admin.register(Event)
|
|
|
|
class EventAdmin(admin.ModelAdmin):
|
2016-07-13 20:37:20 +00:00
|
|
|
list_display = [
|
|
|
|
'title',
|
|
|
|
'event_type',
|
|
|
|
]
|
|
|
|
|
2016-08-04 21:03:39 +00:00
|
|
|
inlines = [
|
|
|
|
SpeakerInline
|
|
|
|
]
|