symposion_app/pinaxcon/proposals/admin.py

46 lines
1.5 KiB
Python
Raw Normal View History

from django.contrib import admin
from pinaxcon.proposals import models
from symposion.proposals import models as symposion_models
2017-09-22 06:37:36 +00:00
from symposion.reviews.models import ProposalResult
class CategoryAdmin(admin.ModelAdmin):
class AdditionalSpeakerInline(admin.TabularInline):
model = symposion_models.AdditionalSpeaker
2017-09-22 06:37:36 +00:00
class ProposalResultInline(admin.TabularInline):
model = ProposalResult
readonly_fields = ["score"]
fields = ["status"]
inlines = [
AdditionalSpeakerInline,
2017-09-22 06:37:36 +00:00
ProposalResultInline,
]
2017-09-22 06:37:36 +00:00
for model in [ models.TalkProposal, models.TutorialProposal,
models.MiniconfProposal, models.SysAdminProposal,
models.KernelProposal, models.GamesProposal,
models.OpenHardwareProposal, models.OpenEdProposal,
2018-10-03 08:19:22 +00:00
models.DevDevProposal, models.ArtTechProposal,
2019-01-13 23:02:27 +00:00
models.DocsProposal, models.SecurityProposal ]:
2017-09-22 06:37:36 +00:00
admin.site.register(model, CategoryAdmin,
list_display = [
"id",
"title",
"speaker",
"speaker_email",
"kind",
"target_audience",
"status",
"cancelled",
],
list_filter = [
"result__status",
"cancelled",
],
)