Add search fields to articles and attachments admin

This commit is contained in:
Gabriel Augendre 2020-12-30 11:32:26 +01:00
parent f4a0ac6d6c
commit 4ef93a913b
No known key found for this signature in database
GPG key ID: 1E693F4CE4AEE7B4
2 changed files with 2 additions and 0 deletions

View file

@ -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"):

View file

@ -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"]