Allow attendees and attendee profiles to be managed via the admin site so organisers can fill out details on attendees' behalf, eg. for invited speakers.
23 lines
876 B
Python
23 lines
876 B
Python
from django.contrib import admin
|
|
|
|
from .models import PastEvent
|
|
from .models import AttendeeProfile
|
|
|
|
admin.site.register(PastEvent)
|
|
|
|
|
|
@admin.register(AttendeeProfile)
|
|
class AttendeeProfileAdmin(admin.ModelAdmin):
|
|
model = AttendeeProfile
|
|
|
|
list_display = ("attendee", "attendee_name", "company", "country", "state", "attendee_completed_registration", "attendee_ticket_type")
|
|
list_filter = ("attendee__completed_registration", "company", "country")
|
|
|
|
def attendee_completed_registration(self, obj):
|
|
return obj.attendee.completed_registration
|
|
attendee_completed_registration.admin_order_field = "attendee__completed_registration"
|
|
attendee_completed_registration.short_description = "Completed Registration?"
|
|
|
|
def attendee_ticket_type(self, obj):
|
|
return obj.attendee.ticket_type
|
|
attendee_ticket_type.short_description = "Ticket Type"
|