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

Add alias searching to mailinglists and show them in the admin overview

parent 0a3e2216
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from members.models import Member
from .models import ListAlias, MailingList, VerbatimAddress
......@@ -13,7 +14,13 @@ class ListAliasInline(admin.TabularInline):
@admin.register(MailingList)
class GeneralMeetingAdmin(admin.ModelAdmin):
class MailingListAdmin(admin.ModelAdmin):
model = Member
filter_horizontal = ('members',)
inlines = (VerbatimAddressInline, ListAliasInline)
list_display = ('name', 'alias_names',)
search_fields = ['name', 'prefix', 'aliasses__alias']
def alias_names(self, obj):
return [x.alias for x in obj.aliasses.all()]
alias_names.short_description = _('List aliasses')
Markdown is supported
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