symposion_app/pinaxcon/proposals/admin.py

58 lines
1.7 KiB
Python

from django.contrib import admin
from pinaxcon.proposals import models
from symposion.proposals import models as symposion_models
from symposion.reviews.models import ProposalResult
class CategoryAdmin(admin.ModelAdmin):
class AdditionalSpeakerInline(admin.TabularInline):
model = symposion_models.AdditionalSpeaker
class ProposalResultInline(admin.TabularInline):
model = ProposalResult
readonly_fields = ["score"]
fields = ["status"]
inlines = [
AdditionalSpeakerInline,
ProposalResultInline,
]
models_to_register = [
models.CopyleftComplianceProposal,
models.MemberProjectProposal,
models.ContainerDaysProposal,
models.SustainableOpenSourceBusinessProposal,
models.DiversityEquityInclusionProposal,
models.FOSSAtPlayProposal,
models.OpenSourcAIDataProposal,
models.OpenWorkProposal,
models.CommunityProposal,
models.BSDUnixProposal,
models.XMPPProposal,
models.ScienceOfCommunityProposal,
models.AArch64ARM64Proposal,
models.FOSSForEducationProposal,
models.FOSSInDailyLifeProposal,
]
for model in models_to_register:
admin.site.register(model, CategoryAdmin,
list_display = [
"id",
"title",
"speaker",
"speaker_email",
"kind",
"target_audience",
"status",
"cancelled",
],
list_filter = [
"result__status",
"cancelled",
],
)