Commit a62af4a1 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Add sorting, searching and filtering to committeememberships and connected members

parent ba7b9d76
from django.contrib import admin
from activemembers.forms import CommitteeMembershipForm
from utils.translation import TranslatedModelAdmin
from . import models
......@@ -36,7 +36,11 @@ class BoardAdmin(TranslatedModelAdmin):
@admin.register(models.CommitteeMembership)
class CommitteeMembershipAdmin(TranslatedModelAdmin):
form = CommitteeMembershipForm
list_display = ('member', 'committee', 'since', 'until', 'chair', 'role')
list_filter = ('committee',)
search_fields = ('member__user__first_name', 'member__user__last_name',
'member__user__email')
@admin.register(models.Mentorship)
......
from django import forms
from activemembers.models import CommitteeMembership
from members.models import Member
class CommitteeMembershipForm(forms.ModelForm):
member = forms.ModelChoiceField(
queryset=Member.objects.order_by('user__first_name',
'user__last_name'))
class Meta:
model = CommitteeMembership
exclude = ()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment