f2.save()
bf = BarForm({'foos': [f1.id, f2.id]})
b = bf.save(commit=false)
if not bf.is_valid():
    print(bf.errors)
else:
    for key, value in list(bf.cleaned_data.items()):
        pass
How to work with unsaved many-to-many relations in django?