question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Check if value changed before marking as modified

See original GitHub issue

Data proxy is always marked as modified after its set() method is called. It does not check if the value was really changed before marking it as modified.

https://github.com/Scille/umongo/blob/15f0ca9751ed9e1c41d5e7aa98a9d075b8ec2e38/umongo/data_proxy.py#L145-L153

I think it can be more performant if the equivalence check is performed since it may save a commit to database.

Correct me if I misunderstand anything. 😃

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
momocowcommented, Dec 4, 2019

I’m testing on my own branch, making it as a per-collection flag and a per-field flag also. A demo snippet will be provided when I think I’m ready 😉

0reactions
lafrechcommented, Nov 19, 2019

@momocow Yes, my proposal was a global flag. But I have no objection to a per-collection flag. Can’t investigate this right now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

how do i check if property actually change before an update
State = EntityState.Modified; _context.saveChanges();. Will update all the relevant field of the entity, thus marked as dirty. On the code ...
Read more >
how to check if field values changed before save - ServiceNow
Hey there, I am trying to update my table specific Update & Save UI actions to check if any values have changed before...
Read more >
how to check whether an entity is unchanged or modified in ...
I used the below code to get state (changed or unchanged). system.data. ... Iam getting s value as Detached insted of unchanged or...
Read more >
Checking for Modified or Changed Fields in Script
If you just want to do a check to see if any value on the entire form changed (a dirty form), you can...
Read more >
Find which properties changed on modified event - AutoCAD ...
So I decided to do a quick try with .NET properties, basically using reflection mechanism to store the data and compare back. Below...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found