feat: add on_update to the field by vvanglro · Pull Request #1273 · ormar-orm/ormar
This is a refinement of the #532.
huangsong and others added 22 commits
January 17, 2022 12:00CodSpeed Performance Report
Merging #1273 will degrade performances by 24.44%
Comparing vvanglro:pr532 (20e90ed) with master (3a206dd)
Summary
⚡ 1 improvements
❌ 1 regressions
✅ 82 untouched benchmarks
⚠️ Please fix the performance issues or acknowledge them on CodSpeed.
Benchmarks breakdown
| Benchmark | master |
vvanglro:pr532 |
Change | |
|---|---|---|---|---|
| ⚡ | test_get_all_with_related_models[10] |
68.2 ms | 60.6 ms | +12.49% |
| ❌ | test_get_or_none[250] |
10 ms | 13.2 ms | -24.44% |
| for k, v in self_fields.items() | ||
| if k in _columns or k in onupdate_fields | ||
| } | ||
| if not kwargs and not _columns: |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If all are null here, the update is based on user-modified attributes on the instance, with user-modified attributes taking precedence over on_update.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters