views:

17

answers:

0

I have a setup where I can upload many pictures at once inline and it looks like this: alt text

This works perfectly. And I can also reorder them with jquery sortable

Here is the related code so you see what's happening:

class PhotoInline(admin.StackedInline):
    model = Photo
    extra = 0
    form = PhotoModelForm

    fieldsets = (
        (None, {
            'fields': ('original_image',)
        }),
        (u'Upplýsingar', {
            'classes': ('collapse',),
            'fields': ('name', 'caption', 'href', 'order')
        }),
    )

What I want to know, is whether this is a simple way to load the inline objects into the form after the images have uploaded?

I'm thinking about something like:

<script type="text/javascript">
    $('.inline-group').load('/path/to/custom/view');
</script>

preferably I would like to append each new photo right after each upload. So...

<script type="text/javascript">
    $('.inline-group').append('/path/to/custom/view');
</script>

If anyone is interested I can post my scripts for mass upload and reordering inline files.