'Returns True if the form needs to be multipart-encoded, i.e. it has
FileInput. Otherwise, False.'

def is_multipart(self):

    for field in self.fields.values():
        if field.widget.needs_multipart_form:
            return True
    return False
