change widget UploadedFile.objects.get(id=data.get('image')) to UploadedFile.objects.get(id=data.get(name))