Closed GeyseR closed 2 years ago
Is there a problem with calling .save_dirty_fields() on an unsaved instance that doesn't exist in the DB? I would've expected that to work
yes, django raises the error when trying to pass update_fields for the unsaved model https://github.com/romgar/django-dirtyfields/pull/200/files#diff-d48931ca655ff96651d77e9dc164175fff4906a08cadc62fb59e80b39c01c264R76
Thanks for the quick response! can you fix the flake8 error? or I can
Thanks for the quick response! can you fix the flake8 error? or I can
fixed
in one of our projects with have a pattern, when we have an instance of a model, but don't know was it save to the DB or not. After updating several its fields we want to use optimized save_dirty_fields method for existing models, but save the full model otherwise.
So in this PR I try to suggest a way for simplify the case by adding a new argument to the save_dirty_fields method