4๐
I have faced similar problems with file uploads in django forms. This is what I hope should help you out(provided you are willing to alter the required
attribute of the archivefile field.)
if request.method == 'GET':
if learningobject_pk:
print learningobject_pk
instance = LearningObject.objects.get( pk=learningobject_pk)
print instance
form = LearningObjectuploadform(request.POST or None, request.FILES or None, instance=instance)
form.base_fields['archivefile'].required = False
else:
form = LearningObjectuploadform()
๐คAnimesh Sharma
Source:stackexchange.com