__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)"
__license__ = "AGPL v3"
from django.contrib import admin
from guardian.admin import GuardedModelAdmin
from .models import (
Organization,
OrganizationLogo,
OrganizationEvent,
ContactPerson,
Contact,
ContactRole,
)
[docs]class OrganizationLogoInline(admin.TabularInline):
model = OrganizationLogo
extra = 0
[docs]class OrganizationEventInline(admin.TabularInline):
model = OrganizationEvent
extra = 0
[docs]class OrganizationAdmin(GuardedModelAdmin):
inlines = [
OrganizationLogoInline,
OrganizationEventInline,
ContactPersonInline,
]
search_fields = ["name", "acronym"]
autocomplete_fields = [
"parent",
"superseded_by",
]
admin.site.register(Organization, OrganizationAdmin)
admin.site.register(Contact, ContactAdmin)