MCPcopy
hub / github.com/dataelement/Clawith / update

Method update

backend/app/dao/base.py:71–79  ·  view source on GitHub ↗

Update an existing record.

(self, *, db_obj: ModelType, obj_in: dict[str, Any])

Source from the content-addressed store, hash-verified

69 return db_obj
70
71 async def update(self, *, db_obj: ModelType, obj_in: dict[str, Any]) -> ModelType:
72 """Update an existing record."""
73 async with self.session() as db:
74 for field, value in obj_in.items():
75 if hasattr(db_obj, field):
76 setattr(db_obj, field, value)
77 db.add(db_obj)
78 await db.flush()
79 return db_obj
80
81 async def delete(self, *, id: Any) -> ModelType | None:
82 """Delete a record by ID."""

Callers 15

handleSaveFunction · 0.80
handleSaveSettingsFunction · 0.80
handleSaveWelcomeMessageFunction · 0.80
AgentDetailPageFunction · 0.80
SettingsTabFunction · 0.80
_update_extraMethod · 0.80
executeMethod · 0.80
_build_payloadMethod · 0.80

Calls 3

sessionMethod · 0.95
addMethod · 0.45
flushMethod · 0.45

Tested by 8

make_userFunction · 0.64
make_agentFunction · 0.64
make_userFunction · 0.64
make_agentFunction · 0.64
make_userFunction · 0.64
make_userFunction · 0.64
make_userFunction · 0.64
make_toolFunction · 0.64