From 4ef93a913b9583e77c052c3676c216c4aa781e48 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Wed, 30 Dec 2020 11:32:26 +0100 Subject: [PATCH] Add search fields to articles and attachments admin --- articles/admin.py | 1 + attachments/admin.py | 1 + 2 files changed, 2 insertions(+) diff --git a/articles/admin.py b/articles/admin.py index bad4832..f514851 100644 --- a/articles/admin.py +++ b/articles/admin.py @@ -71,6 +71,7 @@ class ArticleAdmin(admin.ModelAdmin): ] prepopulated_fields = {"slug": ("title",)} change_form_template = "articles/article_change_form.html" + search_fields = ["title", "content"] def publish(self, request, queryset): if not request.user.has_perm("articles.change_article"): diff --git a/attachments/admin.py b/attachments/admin.py index c0078d7..016e20c 100644 --- a/attachments/admin.py +++ b/attachments/admin.py @@ -33,6 +33,7 @@ class AttachmentAdmin(admin.ModelAdmin): "set_as_open_graph_image", "reprocess_selected_attachments", ] + search_fields = ["description", "original_file", "processed_file"] class Media: js = ["attachments/js/copy_url.js"]