MCPcopy Create free account
hub / github.com/internetarchive/openlibrary / comment_request

Method comment_request

openlibrary/core/edits.py:277–289  ·  view source on GitHub ↗
(cls, rid: int, username: str, comment: str)

Source from the content-addressed store, hash-verified

275
276 @classmethod
277 def comment_request(cls, rid: int, username: str, comment: str) -> int:
278 oldb = db.get_db()
279
280 comments = cls.get_comments(rid)
281 comments["comments"].append(cls.create_comment(username, comment))
282
283 return oldb.update(
284 cls.TABLENAME,
285 where="id=$rid",
286 comments=json.dumps(comments),
287 updated=datetime.datetime.utcnow(),
288 vars={"rid": rid},
289 )
290
291 @classmethod
292 def find_by_id(cls, rid: int):

Callers 1

update_requestMethod · 0.80

Calls 4

get_commentsMethod · 0.80
create_commentMethod · 0.80
dumpsMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected