diff --git a/partners/admin.py b/partners/admin.py index d2277fbda497776fd96edc7b2723acb0e5be8f52..50290d597a3c74dc13f05feb92afa0e769e2724f 100644 --- a/partners/admin.py +++ b/partners/admin.py @@ -1,24 +1,26 @@ from django.contrib import admin -from .models import Contact, Partner, Consortium, ProspectivePartner, MembershipAgreement,\ - ProspectiveContact - +from .models import Contact, Partner, PartnerEvent, Consortium,\ + ProspectivePartner, ProspectiveContact, ProspectivePartnerEvent,\ + MembershipAgreement class ProspectiveContactInline(admin.TabularInline): model = ProspectiveContact extra = 0 - -class PartnerAdmin(admin.ModelAdmin): - search_fields = ('institution', ) - +class ProspectivePartnerEventInline(admin.TabularInline): + model = ProspectivePartnerEvent class ProspectivePartnerAdmin(admin.ModelAdmin): - inlines = (ProspectiveContactInline,) + inlines = (ProspectiveContactInline, ProspectivePartnerEventInline,) list_display = ('institution_name', 'date_received', 'status') list_filter = ('kind', 'status') +class PartnerAdmin(admin.ModelAdmin): + search_fields = ('institution', ) + + admin.site.register(Partner, PartnerAdmin) admin.site.register(Contact) admin.site.register(Consortium) diff --git a/partners/models.py b/partners/models.py index 075826f7a86405aba6cd7ebe72e3a7a862348d55..fd757800dda2217eeeee193c322842739cbaa2f9 100644 --- a/partners/models.py +++ b/partners/models.py @@ -83,7 +83,7 @@ class ProspectivePartnerEvent(models.Model): blank=True, null=True) def __str__(self): - return '%s: %s' % (str(self.prospective_partner), self.get_event_display()) + return '%s: %s' % (str(self.prospartner), self.get_event_display()) ###########################