I'm trying to create a "cool" image uploading interface in django admin panel. The problem is that I'm using inline interface for uploading image instances, but I'm using jQuery Ajax form to upload images, so there were another form I need to create for uploading. And now django view function can't receive request.FILES from this form, because I've created it without using django.forms and can't specify in view function which form needs to be used. So I can't override standard view function for inline interfaces and can't recreate this form using django.forms. So this code doesn't seem to work:
My form:
<form id="uploadForm" enctype="multipart/form-data" method="post" action="upload_picture/">
<input type="file" name="file" />
<input type="submit" value="Upload" />
</form>
My view function:
def upload_picture(request):
if request.method == 'POST':
save_original(request.FILES['file'])
return HttpResponseRedirect('admin/edit_inline/picture_editor.html')
Maybe I should make it completely different way?