Filter/search image attachments by filename

This commit is contained in:
Jeremy Stretch 2025-07-18 16:17:30 -04:00
parent 84c36a11b4
commit adb8e53823
2 changed files with 2 additions and 0 deletions

View File

@ -458,6 +458,7 @@ class ImageAttachmentFilterSet(ChangeLoggedModelFilterSet):
return queryset
return queryset.filter(
Q(name__icontains=value) |
Q(image__icontains=value) |
Q(description__icontains=value)
)

View File

@ -19,6 +19,7 @@ class ImageAttachmentIndex(SearchIndex):
model = models.ImageAttachment
fields = (
('name', 100),
('filename', 110),
('description', 500),
)
display_attrs = ('description',)