我希望保存我的表单实例,然后找到Create objects in for loop。
如果我有以下情况,我怎样才能达到类似效果:
pk = self.kwargs['pk']
C = {'dog':'Nash', 'cat':'Luffy'}
for animal,owner in C.items():
form.instance.owner = owner
form.instance.animal = animal
form.instance.patient = Clinic.objects.get(pk=pk)