MCPcopy Create free account
hub / github.com/dot-agent/nextpy / _dict_recursive

Method _dict_recursive

nextpy/data/model.py:77–89  ·  view source on GitHub ↗

Recursively serialize the relationship object(s). Args: value: The value to serialize. Returns: The serialized value.

(cls, value)

Source from the content-addressed store, hash-verified

75
76 @classmethod
77 def _dict_recursive(cls, value):
78 """Recursively serialize the relationship object(s).
79 Args:
80 value: The value to serialize.
81
82 Returns:
83 The serialized value.
84 """
85 if hasattr(value, "dict"):
86 return value.dict()
87 elif isinstance(value, list):
88 return [cls._dict_recursive(item) for item in value]
89 return value
90
91 def dict(self, **kwargs):
92 """Convert the object to a dictionary.

Callers 1

dictMethod · 0.95

Calls 1

dictMethod · 0.45

Tested by

no test coverage detected