使用多个数据库保存

问题描述

我正在使用多个数据库

public class myClass{
    public String obj;
    public int expected;
    public int found;

    public myClass(String obj,int expected,int found){
        this.obj = obj;
        this.expected = expected;
        this.found = found;
    }
}

现在在使用inlineformset_factory时,我正在尝试保存([email protected]) 但出现错误 “ save()获得了意外的关键字参数“使用” 我在views.py中使用的位置

private List<myClass> convertToMap(String[] info){
    ArrayList<myClass> newList = new ArrayList<myClass>();
    for(int i = 0; i < info.length; i += 3){
        if(i < info.length){
          newList.add(new myClass(info[i],Integer.parseInt(info[i+1]),Integer.parseInt(info[i+2])));
        }
    }
    return newList;
}

解决方法

您需要引用数据库名称,例如。 form.save(using='[email protected]')