F
F
Friend2018-12-19 18:05:42
Django
Friend, 2018-12-19 18:05:42

How to load in models. ImageField multiple photos at once via admin?

How can I immediately load a pack of pictures in models. ImageField via admin?
Now you need to select and indicate each photo separately, and this is very impractical.

class Gallery(models.Model):
  name  = models.CharField(max_length=50)
  ...
  ...

class ImageGallery(models.Model):
    image = models.ImageField(upload_to='my_path/')
    gallery = models.ForeignKey('Gallery', on_delete=models.CASCADE)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim Shatalov, 2018-12-19
@netpastor

Standard in any way
Use or third-party loaders - like https://github.com/Chive/django-multiupload
Well, or customize the form of the element - https://www.djangosnippets.org/snippets/1053/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question