How to upload multiple images to a Django field

I checked a lot of downloaders for the django image field. But I can't get an easy way to do multiple image uploads in Django.

My requirement

Class Foo(models.Model):
       images = SomeImageField(upload_to = "/path/")

This will allow me to upload multiple images. Now django-photologue allows you to upload a gallery, but this is only in zip format . I want something like that. Is such an application available?

+4
source share
1 answer

django-filer ( , django) . , django admin StackedInline -

# models.py
from django.db import models
from filer.fields.imagefields import FilerImageField

class MyObject(models.Model):
    name = models.CharField(...)

class Image(models.Model):
    image_file = FilerImageField()
    obj = models.ForeignKey(MyObject, ...)

# admin.py
from django.contrib import admin
from models import Image, MyObject

class ImageInline(admin.StackedInline):
    model = Image

class MyObjectAdmin(admin.ModelAdmin):
    inlines = [ImageInline, ]

...

.

, .

+4

All Articles