zmathew/django-ajax-upload-widget — pull request #2 by chenhouwu (2012-10-25 01:14:13+00:00)
Title: fix: update a model with a already uploaded file field untouched.

for example, a FileField has parameter such as upload_to='img'.

If you *newly upload* a new file it will all be ok, because in the ajax post, the url of "ajax_uploads/some_uuid_filename.jpg" will be used.

But if you have already uploaded the file, and just want to updata other fields in the form,
the form will be initialized with "img/some_uuid_filename.jpg" for the file field.
and the code:

uploaded_file = UploadedFile.objects.get(file=relative_path)

will failed, because all files in UploadedFile are in fact "ajax_uploads/some_uuid_filename.jpg"

A field not in the form of "ajax_uploads/some_uuid_filename.jpg" has no newly uploaded file, thus we should ignored it.