We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 57aad36 commit 5617a47Copy full SHA for 5617a47
synalinks/src/backend/pydantic/core.py
@@ -562,6 +562,19 @@ def __rxor__(self, other):
562
ops.Xor()(other, self),
563
)
564
565
+ def __contains__(cls, other):
566
+ """Check if the schema of `other` is contained in this one.
567
+
568
+ Args:
569
+ other (SymbolicDataModel | DataModel): The other data model to compare with.
570
571
+ Returns:
572
+ (bool): True if all properties of `other` are present in this one.
573
+ """
574
+ from synalinks.src.backend.common.json_schema_utils import contains_schema
575
576
+ return contains_schema(cls.get_schema(), other.get_schema())
577
578
def get_config(self):
579
return self.get_json()
580
0 commit comments