Skip to content
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.

Commit

Permalink
show ancestors when filtering admin trees
Browse files Browse the repository at this point in the history
  • Loading branch information
evildmp committed May 2, 2013
1 parent d363f25 commit 92a78a7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contacts_and_people/admin.py
Expand Up @@ -388,7 +388,8 @@ class EntityAdmin(PersonAndEntityAdmin, TreeAdmin):
'slug': ('name',)
}
readonly_fields = ['address_report']

filter_include_ancestors = True

def address_report(self, instance):
if not instance.abstract_entity:
return "%s" % (", ".join(instance.get_full_address)) or "Warning: this Entity has no address."
Expand Down
1 change: 1 addition & 0 deletions links/admin.py
Expand Up @@ -120,6 +120,7 @@ class ExternalSiteAdmin(TreeAdmin):
readonly_fields = ('parent',)
form = ExternalSiteForm
list_display = ('domain', 'site',)
filter_include_ancestors = True


admin.site.register(ExternalLink, ExternalLinkAdmin)
Expand Down
3 changes: 3 additions & 0 deletions news_and_events/admin.py
Expand Up @@ -213,6 +213,9 @@ class EventAdmin(NewsAndEventsAdmin, TreeAdmin):
search_fields = ['title']
list_filter = (EventIsSeries, 'start_date', HostedByFilter)
save_as = True

filter_include_ancestors = True

# autocomplete fields
related_search_fields = ['hosted_by','parent','building', 'external_url']

Expand Down

0 comments on commit 92a78a7

Please sign in to comment.