I have these models:
class Gallery(models.Model):
HeadImage = models.ImageField(upload_to="gallery")
class Image(models.Model):
Image = models.ImageField(upload_to="gallery")
Gallery = models.ForeignKey(Gallery, related_name='images',blank=True)
class Agency(models.Model):
# some fields ...
Gallery=models.ForeignKey(Gallery)
Now I want to, when adding an Agency, instead of showing just an stupid combobox for Gallery field, I have these things:
A file upload for HeadImage field in Gallery model and a set of file uploads
for Image field in Image model. Some thing like adding an object(Agency) with it's related objects(Gallery related to Agency and Image related to gallery)in one form. How can I do this? I didn't find any solution after googling a lot, that sounds an awful problem.
edit: I mean save an Glaaery with a set of it's images and save agency with it's gallery at the same form.
thanks for any help
AgencytoGallerythat @Asima does not like.