skip_row does not detect the difference when m2m objects are being updated
See original GitHub issueskip_row
method does not the difference between ManyToMany objects in instance
or original
because the instance
related objects remain unchanged.
When using skip_row
all models where m2m changed are detected as unchanged thus the whole transaction is skipped
Issue Analytics
- State:
- Created 8 years ago
- Reactions:4
- Comments:5
Top Results From Across the Web
django - Can I detect ManyToManyField mutations before they ...
I was able to use the m2m_changed signal to react to the post_* actions and dispatch the broadcast after the object is all...
Read more >Detecting modifications in ManyToMany field - Google Groups
Hello, I would like to detect changes in a ManyToMany field, to update data in the linked Model. I've two objects : class...
Read more >What's new in 0.24.0 (January 25, 2019) - Pandas
We can construct a Series with the specified dtype. The dtype string Int64 is a pandas ExtensionDtype . Specifying a list or array...
Read more >14 Simple Tips to save RAM memory for 1+GB dataset - Kaggle
In python notebook once a dataset loads into RAM it does not free on its own. ... Immediately we can see that most...
Read more >MySQL Workbench
Document all SQL object types. • Document output available in different file formats. A comparison of edition features can be found at MySQL ......
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 FreeTop 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
Top GitHub Comments
Am I missing something or did you cache the file row data in
_row
somewhere else (looking at the 0.7.0 & 1.0.0 releasesI also struggled to update a M2M field which was defined like this:
What I ended up doing was to write custom code in the
import_obj()
method, where I manually compare the instance.tags with the row.tags, and do a instance.tags.set() with the corresponding ids (having transformed the tag names into ids beforehand). More importantly, and similarly to a comment above, I addself._m2m_updated = True
(False if no changes) before calling super, so that I’m able to setskip_row()
to False for these rows.Please let me know if there is something easier to do 🤔 🙏
Full code below, hope it helps 😃