Skip to content

Cardinality on both side of pairs #867

@fsalmasri

Description

@fsalmasri

in the example:

class Person(StructuredNode):
    car = RelationshipTo('Car', 'CAR', cardinality=ZeroOrMore)


class Car(StructuredNode):
    owner = RelationshipFrom('Person', 'CAR', cardinality=One)

The relationship cardinality is different on both sides. Person can have zero or more cars, but car can be owned by one person.

when connecting two persons two car this won't raise an error, but when connecting car two persons this will raise an error. cardinality is only checked on the car side.

why cardinality is not verified, on both pairs when relationship is connected.

Also car nodes can't be created without a connection without raising an error even though the cardinality is One.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions