Double insert of rows while importing
See original GitHub issueWhen importing a CSV via the admin interface, the rows in the sheet are being imported twice. Once when loading preview and once when confirming import. Importing with the id
column left empty. I’ve used the library before and I’ve never faced this issue before. Super confused!
Django==2.1.3 django-import-export==2.1.0
class ReviewsResource(resources.ModelResource):
class Meta:
model = Review
fields = ('id', the remaining fields in the model...)
class Review(models.Model):
.. few field definitions
class Meta:
managed = False
db_table = 'review'
def __str__(self):
return str(self.id)
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
preventing duplicate row insertion in mysql while importing ...
Preventing duplicate row insertion in mysql while importing csv file .I want to insert data into mysql table via importing csv file. how...
Read more >duplicate record while importing and inserting csv file data into ...
1 Answer 1 · Hi tushar , i am getting error .. · @learnjqueery you need to do accmap. · tushar.. · @learnjqueery...
Read more >13.2.7.2 INSERT ... ON DUPLICATE KEY UPDATE Statement
This function is especially useful in multiple-row inserts. The VALUES() function is meaningful only in the ON DUPLICATE KEY UPDATE clause or INSERT...
Read more >- Import - Duplicate row error - Community - Teradata Support
Possible solutions: 1. Load the data into a multiset table. If the target table must be a set table, you can "insert ......
Read more >To insert several rows in a one cell in import csv file
I prepared an import file in the MS Excel. There is column "Description". One cell in this column contains several rows where each...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I wrote a subclass for ModelResouce to fix this and its working fine.
ATM, I would say not unless this is a common use case that many people are running into. Otherwise, I think they can benefit from your snippet.