Skip to content

Conversation

@bjester
Copy link
Member

@bjester bjester commented Jan 21, 2026

Summary

  • Adds optional exclude kwarg to *clean_fields methods on SyncableModel, in parity with Django's clean_fields
  • Adds optional sync_filter kwarg to *clean_fields methods on SyncableModel to support excluding fields based off the current sync filter
  • Adds optional sync_filter kwarg to deserialize methods on SyncableModel and Store to allow passthrough from deserialization operation, and passes it through to *clean_fields methods
  • Updates the deserialization to passthrough the current sync filter to model deserialization methods

TODO

  • Have tests been written for the new code?
  • Has documentation been written/updated?
  • New dependencies (if any) added to requirements file

Reviewer guidance

  • Do the tests cover the updates reasonably? The deserialization tests were modeled after what we expect to implement in Kolibri
  • I chose to use exclude for the *clean_fields kwarg because it matches Django's kwarg

Issues addressed

closes #281

@bjester bjester force-pushed the synchronized-filtering-context branch from de7b43e to 0042810 Compare January 21, 2026 20:04
@bjester bjester changed the title Allow passthrough of sync_filter during deserialization and model validation (clean) logic Allow passthrough of sync_filter during deserialization and model validation logic Jan 21, 2026
@bjester bjester changed the title Allow passthrough of sync_filter during deserialization and model validation logic Allow passthrough of sync_filter in deserialization and model validation logic Jan 21, 2026
@bjester bjester marked this pull request as ready for review January 21, 2026 20:42
@bjester bjester requested a review from ozer550 January 21, 2026 20:46
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.

Pass Sync Filter to Model Deserialization for Flexible Foreign Key Handling

1 participant