Add: search fields to file admin page for submission files

This commit is contained in:
Aroy-Art 2024-10-19 23:59:41 +02:00
parent 262cdfe2fd
commit 78db9902b0
Signed by: Aroy
GPG key ID: DB9689E9391DD156

View file

@ -9,6 +9,7 @@ from .models import Metadata_Files, Submission_File, User_Profile_Images, User_B
class Submission_FileAdmin(admin.ModelAdmin): class Submission_FileAdmin(admin.ModelAdmin):
list_display = ('id', 'file_link', 'date_added', 'file_hash', 'file',) list_display = ('id', 'file_link', 'date_added', 'file_hash', 'file',)
search_fields = ['file_name', 'file_hash']
def file_link(self, obj): def file_link(self, obj):
url = reverse("admin:files_submission_file_change", args=[obj.id]) url = reverse("admin:files_submission_file_change", args=[obj.id])