Store list of images in django model
arrays, django, imagefield, model, python
Solution
Create another model to images and have foreignkey with your model.
def YourModel(models.Model):
#your fields
def ImageModel(models.Model):
mainimage = models.ImageField(upload_to='img', null = True)
image = models.ForeignKey(YourModel, ...)
Problem
I am building a Django data model and I want to be able to store an array of ImageFields. Is it possible? ``` mainimage = models.ImageField(upload_to='img', null = True) images = models.?? ``` Thanks.