Answer the question
In order to leave comments, you need to log in
Is it possible to store a set of images in a database?
Is it possible to store a set of images in a Django database, such as a list, so that they can then be retrieved through a loop?
If yes, please tell me how to do it?
Answer the question
In order to leave comments, you need to log in
Write an image model associated with the main one. In addition to this model ImageField
, you can add a name, description, sorting index, etc. As a rule, this additional data is always needed.
class Photoalbum(models.Model):
...
class PhotoalbumImage(models.Model):
photoalbum = models.ForeignKey(Photoalbum, ...)
image = models.ImageField('изображение', ...)
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question