Skip to content

Conversation

@glennmatthews
Copy link
Collaborator

Fixes #13.

  • Add new DSyncModelFlags to DSyncModel which can be set per-class or per-instance as desired.
    • DSyncModelFlags.IGNORE causes an object and its children to be omitted entirely from any diff calculation
    • DSyncModelFlags.SKIP_CHILDREN_ON_DELETE causes DSync to not call .delete() on children of a deleted parent object -- they are still remove() from the DSync local data itself, however.
  • Hard-code enum bitflag values instead of using enum.auto() just to make serialization/deserialization a bit more future-proof.
  • Moved most of the diff calculation logic from DSync to a new DSyncDiffer class in order to reduce the amount of shared state we need to keep passing around during recursive diff construction.
  • Refactored test_dsync.py to have more granular test cases after Jake correctly gave me grief on this point. :-)

@glennmatthews glennmatthews requested a review from dgarros October 21, 2020 15:07
Copy link
Contributor

@dgarros dgarros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great as far as I can tell, there is a lot of changes so hopefully I didn't miss anything but looks exactly as we discussed

@glennmatthews
Copy link
Collaborator Author

Yeah, I should have perhaps saved the Differ refactoring for a separate pull request. Apologies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flag object to be ignore during a diff

3 participants