D
D
Dmitry2015-10-19 01:46:23
Django
Dmitry, 2015-10-19 01:46:23

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:
43d886d898b145b48c8be81d846b8b7f.png
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

Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey K, 2015-10-19
@trec

stackoverflow.com/questions/16307307/django-admin-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question