Skip to content

Allow for recursive data models #225

Open
@Kircheneer

Description

@Kircheneer

Environment

  • DiffSync version: latest

Proposed Functionality

Allow for models to have a model of their own type as children.

Use Case

When modelling locations for example, a location of type country might have locations of type city as its children. Example (assuming #222 is implemented):

class Location(DiffSyncModel):
    _modelname = "location"
    _identifiers = ("name", "location_type", "$parent")
    _children = {"location": "location_children"}

    name: str
    location_type: str

    location_children: List['Location'] = []

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: acceptedThis issue has been accepted by the maintainers team for implementationstatus: blockedAnother issue or external requirement is preventing implementationtype: enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions