Limit filter list on some admin screens

This commit is contained in:
Michael Hall 2018-05-16 21:46:09 -04:00
parent 83ef285f8f
commit cc470ce5fc
2 changed files with 2 additions and 2 deletions

View file

@ -30,7 +30,7 @@ admin.site.register(EmailConfirmation, ConfirmationAdmin)
class EmailAdmin(admin.ModelAdmin):
list_display = ['when', 'recipient_display', 'subject', 'sender_display', 'ok',]
list_filter = ['ok', 'when', 'sender']
list_filter = ['ok', 'when', ('sender', admin.RelatedOnlyFieldListFilter)]
readonly_fields = ['when', 'email', 'subject', 'body', 'ok']
search_fields = ['subject', 'body', 'to']

View file

@ -57,7 +57,7 @@ admin.site.register(Organization, OrgAdmin)
class TeamAdmin(admin.ModelAdmin):
raw_id_fields = ('country', 'spr', 'city', 'owner_profile', 'admin_profiles', 'contact_profiles')
list_display = ('__str__', 'active', 'member_count', 'event_count', 'owner_profile', 'created_date', 'is_premium', 'premium_expires')
list_filter = ('active', 'is_premium', 'organization', 'country',)
list_filter = ('active', 'is_premium', 'organization', ('country',admin.RelatedOnlyFieldListFilter))
ordering = ('-created_date',)
def member_count(self, team):
return team.members.all().count()