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

Method dict

nextpy/data/model.py:91–112  ·  view source on GitHub ↗

Convert the object to a dictionary. Args: kwargs: Ignored but needed for compatibility. Returns: The object as a dictionary.

(self, **kwargs)

Source from the content-addressed store, hash-verified

89 return value
90
91 def dict(self, **kwargs):
92 """Convert the object to a dictionary.
93
94 Args:
95 kwargs: Ignored but needed for compatibility.
96
97 Returns:
98 The object as a dictionary.
99 """
100 base_fields = {name: getattr(self, name) for name in self.__fields__}
101 relationships = {}
102 # SQLModel relationships do not appear in __fields__, but should be included if present.
103 for name in self.__sqlmodel_relationships__:
104 try:
105 relationships[name] = self._dict_recursive(getattr(self, name))
106 except sqlalchemy.orm.exc.DetachedInstanceError:
107 # This happens when the relationship was never loaded and the session is closed.
108 continue
109 return {
110 **base_fields,
111 **relationships,
112 }
113
114 @staticmethod
115 def create_all():

Callers 13

get_deployment_statusFunction · 0.45
jsonMethod · 0.45
createMethod · 0.45
createMethod · 0.45
_dict_recursiveMethod · 0.45
_parse_inputMethod · 0.45
test_upload_fileFunction · 0.45
test_dictFunction · 0.45
interdependent_stateFunction · 0.45
test_computed_var_cachedFunction · 0.45

Calls 1

_dict_recursiveMethod · 0.95

Tested by 7

test_upload_fileFunction · 0.36
test_dictFunction · 0.36
interdependent_stateFunction · 0.36
test_computed_var_cachedFunction · 0.36