Commit 4a601045 authored by Thom Wiggers's avatar Thom Wiggers 📐
Browse files

Merge branch 'feature/filter-commmittee-memberships' into 'master'

 Add sorting, searching and filtering to committeememberships and connected members

See merge request !232
parents ae6a95eb a62af4a1
from django.contrib import admin
from activemembers.forms import CommitteeMembershipForm
from utils.translation import TranslatedModelAdmin
from . import models
......@@ -37,7 +37,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