networktocode / diffsync

A utility library for comparing and synchronizing different datasets.
https://diffsync.readthedocs.io/
Other
155 stars 26 forks source link

non id non attribute fields are not available during creation #259

Open retnuh opened 10 months ago

retnuh commented 10 months ago

Environment

Observed Behaviour

Diffsync doesn't pass along fields that are not ids or attributes during creation.

Expected Behaviour

There should be a mechanism to access those types of fields during create. An example use case would be creating a new object with a default name from source A, but in general source A doesn't know or care about the name and it's not usually part of the diffsync.

Yoyasp commented 9 months ago

I would also like to have this implemented. Lots of datasets i use proved a Primary key that is only locally significant, but is required to make a patch request.

I see in the example that they added a database_pk which is optional, but they never use the value it is assigned.

The only way to lookup this value is in the DiffSync class in the datastore: self.store._data['modelname']['id'].database_pk