Class X(models.Model): zip_file = models.FileField()
Now, this zip_file is a zip having any number of images. I want to be able to extract all the images and save (to DB) them under the same X object i.e. the "primary key" is the same.
I understand that the File is stored in the system and only a reference is stored in the DB and I am fine with it.
I am unsure about what is the best practice to unzip the file at the server and save them one by one to the DB.
One naive idea I have is using the "validators" to check the files and save them to DB but unsure if that is a best practice.
Any help or suggestion is appreciated. :)