D
D
devrais2019-01-22 10:03:22
Django
devrais, 2019-01-22 10:03:22

How to upload multiple images at once in Django?

Hello,

write a website clone
readmanga.me trying
there each m. its number of chapters, and each chapter has a certain number of pages, and each page has its own picture.
here
5c46bd3937e68965335257.png
Implemented it like this
class Page(models.Model):
   page_slug = models.SlugFiekd()
   page_img = models.ImageField(upload_to='/img')

class  Charpters(models.Model):
   charpter_name = models.CharField(max_length=50)
   charpter_slug = models.SlugField()
   charpter_page = models.ManyToManyField(Page)

class Manga(models.Model):
   manga_name = models.CharField(max_length=50)
   manga_slug = models.SlugField()
   manga_charpters = models.ManyToManyField(Charpters)

It turned out to be some kind of masochism.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question