Browse Source

Add search fields to articles and attachments admin

packaging
Gabriel Augendre 9 months ago
parent
commit
4ef93a913b
No known key found for this signature in database GPG Key ID: 1E693F4CE4AEE7B4
  1. 1
      articles/admin.py
  2. 1
      attachments/admin.py

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

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

Loading…
Cancel
Save