You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to define the number of relationships that can exist between two types of nodes. Not only for uniqueness, but also for logic.
class Sedan(StructuredNode):
seat = RelationshipFrom('SEAT', 'INCLUDED_IN', max_rels=4)
# this sedan can have up to 4 seats
class Person(StructuredNode):
car = RelationshipFrom('CAR', 'OWNED_BY', max_rels=1)
# this car can only have up to 1 owner
class Router(StructuredNode):
devices = RelationshipFrom('ROUTER', 'CONNECTED_TO', max_rels=30)
I am aware that I could do this easily enough in application logic with simple if statements, but it would be nice not to have to write them. I keep winding up with these duplicate relationships when things slip through in testing.
I suppose I'm just scared to dive into the world of open source contribs =\
The text was updated successfully, but these errors were encountered:
Not exactly helping but this is a Multiplicity constraint and the foundation for doing this is already there in StructuredRel via Cardinality. It is a matter of adding the constrain checks.
It would be nice to define the number of relationships that can exist between two types of nodes. Not only for uniqueness, but also for logic.
I am aware that I could do this easily enough in application logic with simple if statements, but it would be nice not to have to write them. I keep winding up with these duplicate relationships when things slip through in testing.
I suppose I'm just scared to dive into the world of open source contribs =\
The text was updated successfully, but these errors were encountered: