Answer the question
In order to leave comments, you need to log in
Is it possible to display in django fieldsets not a form field, but an image?
I display all photos from this gallery in the gallery editing form.
I do not need the ability to edit photos, and it is closed for photos, but you can and should delete it.
And in order to understand what to delete, you need to display not the file name, but the image itself.
Now I output it like this:
Is it possible to display the image itself instead of the image name field? As shown by the red illustration ))
The code that displays this fieldsets:
class PhotoInline(admin.TabularInline):
fieldsets = (
(None,
{'fields': ('photo', 'order',)}
),
)
model = Photo
extra = 0
max_num = 1
def has_add_permission(self, request):
return False
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question