django-adaptors の importer -optionを使用して「グループ」を追加フィールドとして渡そうとしていますが、次のエラーが発生します...
* の後の add() 引数は、Group ではなくシーケンスでなければなりません
ContactCSVModel.import_data(data=self.filepath, extra_fields="1")
これは私のCsvModelです...
CsvModel.py
class ContactCSVModel(CsvModel):
first_name = CharField()
last_name = CharField()
company = CharField()
mobile = CharField()
groups = DjangoModelField(Group)
class Meta:
delimiter = "^"
dbModel = Contact
update = {
'keys': ['mobile']
}
model.py
class Contact(models.Model):
"""
Stores all contacts.
"""
first_name = models.CharField(max_length=60)
last_name = models.CharField(max_length=60)
company = models.CharField(max_length=100,blank=True)
mobile = models.IntegerField(max_length=20)
active = models.BooleanField(help_text="States if pet type is active/selectable.")
modified = models.DateTimeField(null=True, auto_now=True, help_text="Shows when object was modified.")
created = models.DateTimeField(auto_now_add=True, help_text="Shows when object was created.")
#FK
groups = models.ManyToManyField(Group, related_name='contacts')
git のプロジェクト (以下) を見ると、プロジェクトと many2many フィールドに問題がある可能性があります。それとも私のコードですか?
https://github.com/anthony-tresontani/django-adaptors/blob/master/adaptor/model.py#L436