tortoise / tortoise/tortoise-orm

Signals pre_save and post_save on UPDATE queries

Open
#431 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
5.6k
Forks
516
Avg merge
2d 21h
Merged PRs (30d)
9

Description

Does signals.pre_save and post_save actually work with UPDATE queries or they are only for INSERT?

I did some small search with grep+vim and could not find any call to post* when using update

If they actually are only for INSERT, it would be nice to have pre_update/post_update (or maybe the same pre_save/post_save working also with UPDATE)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the ORM's signal handling and UPDATE query path to verify whether pre_save and post_save are invoked for updates. Compare the existing INSERT behavior with the proposed pre_update/post_update or shared save-signal behavior, then define tests that distinguish both operations and document the expected result.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.