我正在尝试将 csv 文件导入我的 SQL 数据库。这是我的模型:
class Matchups(models.Model):
name = models.CharField(max_length=140)
vs_Ashe = models.CharField(max_length=140)
def __unicode__(self):
return "%s" % (self.name)
class MyCsvModel(CsvDbModel):
name = CharField()
vs_Ashe = CharField()
class Meta:
dbModel = Matchups
delimiter = ","
尝试导入 csv 文件时: my_csv_list = MyCsvModel.import_data(data = open("/home/irmantas/ADC.csv"))
我收到此错误:
A Db model should not have any csv field defined.
问题是什么?