0

I'm getting used to Django and I want to upload a stack of images via browser. The user must be able to upload the whole stack from one field to store the images in the database keeping the order. I think I'm looking for something like:

Class Foo(models.Model):
    MultiImageField(upload_to = "/stack_name/"). 

And i have the models like this:

class Stack(models.Model):
    user = models.ForeignKey('auth.User')
    name = models.CharField(max_length=128)

class Images(models.Model):
    position = models.PositiveIntegerField()
    stack = models.ForeignKey(Stack)
    originalImg = models.ImageField(upload_to='/stacks/')

I'm pretty lost with this, Is there any way to do it?

Thanks.

MrPavlo
  • 11
  • 3
  • Possible duplicate of [Multiple images per Model](http://stackoverflow.com/questions/537593/multiple-images-per-model) – Selcuk Mar 22 '16 at 03:30
  • I'm not looking for uploading from the admin page. I would like to upload from the main view from one field. – MrPavlo Mar 23 '16 at 01:14

0 Answers0