(self, db_session: Session, actor: Optional["User"] = None, no_commit: bool = False)
| 457 | |
| 458 | @handle_db_timeout |
| 459 | def update(self, db_session: Session, actor: Optional["User"] = None, no_commit: bool = False) -> "SqlalchemyBase": |
| 460 | logger.debug(...) |
| 461 | if actor: |
| 462 | self._set_created_and_updated_by_fields(actor.id) |
| 463 | self.set_updated_at() |
| 464 | |
| 465 | # remove the context manager: |
| 466 | db_session.add(self) |
| 467 | if no_commit: |
| 468 | db_session.flush() # no commit, just flush to get PK |
| 469 | else: |
| 470 | db_session.commit() |
| 471 | db_session.refresh(self) |
| 472 | return self |
| 473 | |
| 474 | @classmethod |
| 475 | @handle_db_timeout |
no test coverage detected