(cls, rid: int, username: str, comment: str)
| 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): |
no test coverage detected