MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / Constraint

Class Constraint

tests/flow/constraint_utils.py:4–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2from index_utils import *
3
4class Constraint():
5 def __init__(self, ct, et, lbl, attrs, status):
6 self.s = status
7 self.ct = ct
8 self.et = et
9 self.lbl = lbl
10 self.attrs = attrs
11
12 def __eq__(self, other):
13 return (self.lbl == other.lbl and
14 self.s == other.s and
15 self.et == other.et and
16 self.attrs == other.attrs and
17 self.ct == other.ct)
18
19 @property
20 def label(self):
21 return self.lbl
22
23 @property
24 def status(self):
25 return self.s
26
27 @property
28 def entity_type(self):
29 return self.et
30
31 @property
32 def attributes(self):
33 return self.attrs
34
35 @property
36 def type(self):
37 return self.ct
38
39def get_constraint(g, ct_type, entity_type, lbl, *props):
40 props_filter = "properties = [" + ",".join(["'" + p + "'" for p in props]) + "]"

Callers 2

get_constraintFunction · 0.85
list_constraintsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected