__copyright__ = "Copyright © Stichting SciPost (SciPost Foundation)"
__license__ = "AGPL v3"
from django.contrib import admin
from .models import Fellowship, PotentialFellowship, PotentialFellowshipEvent
[docs]def fellowhip_is_active(fellowship):
return fellowship.is_active()
[docs]class FellowshipAdmin(admin.ModelAdmin):
search_fields = ['contributor__user__last_name', 'contributor__user__first_name']
list_display = ('__str__', 'guest', fellowhip_is_active, )
list_filter = ('guest',)
fellowhip_is_active.boolean = True
date_hierarchy = 'created'
admin.site.register(Fellowship, FellowshipAdmin)
[docs]class PotentialFellowshipEventInline(admin.TabularInline):
model = PotentialFellowshipEvent
[docs]class PotentialFellowshipAdmin(admin.ModelAdmin):
inlines = (PotentialFellowshipEventInline,)
list_display = ('__str__',)
search_fields = ['profile__last_name', 'profile__first_name']
admin.site.register(PotentialFellowship, PotentialFellowshipAdmin)