Environment
Proposed Functionality
The _identifiers of a model should allow a reference to the parent's set of _identifiers.
Use Case
Taking a simple building -> floor parent-child hierarchy the 2nd floor only needs to be unique within its own building. Currently I have to do a workaround like this:
class Floor(DiffSyncModel):
_identifiers = ("name", "building_name")
name: str
building_name: str
when I would much rather want to do something like this
class Floor(DiffSyncModel):
_identifiers = ("name", "$parent")
name: str
to make my floors unique where BuildingModel looks like this:
class Building(DiffSyncModel):
_identifiers = ("name")
_children = {"floor": "floors"}
name: str
floors: List[Floor] = []
Environment
Proposed Functionality
The
_identifiersof a model should allow a reference to the parent's set of_identifiers.Use Case
Taking a simple building -> floor parent-child hierarchy the 2nd floor only needs to be unique within its own building. Currently I have to do a workaround like this:
when I would much rather want to do something like this
to make my floors unique where
BuildingModellooks like this: