I am trying to pass the "group" as an extra field using the importer-option from django-adapters , but I get the following error ...
add () the argument after * must be a sequence, not a group
ContactCSVModel.import_data(data=self.filepath, extra_fields="1")
This is my 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.")
Looking at the project on git (see below), there may be problems with the project and many many fields, maybe, if so, how to fix it? or is this my code?
https://github.com/anthony-tresontani/django-adaptors/blob/master/adaptor/model.py#L436
source share