R
R
Rodion Yurchenko2016-05-27 13:37:37
Django
Rodion Yurchenko, 2016-05-27 13:37:37

How to display image in Django 1.9 admin?

Good afternoon !
There is a model:

class ShopItem(models.Model):
    title = models.CharField(max_length=100)

class ShopItemImg(models.Model):
    ShopItem_id = models.ForeignKey(ShopItem)
    img = models.ImageField(upload_to='shop/', null=True, blank=True)

Question:
How to display a preview of each picture in the admin panel?
and - just display - this is understandable - it needs to be in the ShopItemAdmin section (well, that is, where the main content is, and not separate pictures)
To get something like
-------------- in the admin panel - PRODUCT
NAME
Preview1
Preview2
Preview3
---------------

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav Sklyar, 2016-05-30
@VladSkliar

Try to use this battery

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question