Skip to content

Commit

Permalink
Add Membership to admin
Browse files Browse the repository at this point in the history
  • Loading branch information
VirginiaDooley committed Sep 25, 2023
1 parent 88a8ff6 commit 3e4ed6d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ynr/apps/popolo/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,18 @@ class OrganizationAdmin(admin.ModelAdmin):
inlines = generics.BASE_INLINES


class MembershipAdmin(admin.ModelAdmin):
model = models.Membership
list_display = ("person", "party", "get_ballot", "deselected")
fields = ("person", "party", "ballot", "deselected")
readonly_fields = ("person", "party", "ballot")
list_filter = ("deselected",)

@admin.display(description="Ballot")
def get_ballot(self, obj):
return obj.ballot.ballot_paper_id


admin.site.register(models.Membership, MembershipAdmin)
admin.site.register(models.Post, PostAdmin)
admin.site.register(models.Organization, OrganizationAdmin)

0 comments on commit 3e4ed6d

Please sign in to comment.