MCPcopy
hub / github.com/ormar-orm/ormar / update_from_dict

Method update_from_dict

ormar/models/newbasemodel.py:1259–1270  ·  view source on GitHub ↗

Updates self with values of fields passed in the dictionary. :param value_dict: dictionary of fields names and values :type value_dict: dict :return: self :rtype: NewBaseModel

(self, value_dict: builtins.dict)

Source from the content-addressed store, hash-verified

1257 )
1258
1259 def update_from_dict(self, value_dict: builtins.dict) -> "NewBaseModel":
1260 """
1261 Updates self with values of fields passed in the dictionary.
1262
1263 :param value_dict: dictionary of fields names and values
1264 :type value_dict: dict
1265 :return: self
1266 :rtype: NewBaseModel
1267 """
1268 for key, value in value_dict.items():
1269 setattr(self, key, value)
1270 return self
1271
1272 def _convert_bytes_to_str(
1273 self, column_name: str, value: Any

Callers 5

bulk_updateMethod · 0.80
saveMethod · 0.80
updateMethod · 0.80
loadMethod · 0.80
load_allMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected