Changes between Version 1 and Version 2 of Ticket #36064, comment 4
- Timestamp:
- Jan 7, 2025, 2:48:31 AM (2 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #36064, comment 4
v1 v2 11 11 12 12 {{{ 13 # 1. Model.id has a default 13 14 foo = Model(id=1) 14 foo.save() 15 foo.save(). # INSERT 15 16 bar = Model(id=1) 16 # 1. if Model.id has a default, this raises IntegrityError 17 # 2. if Model.id doesn't have a default, this updates foo 18 bar.save() 17 bar.save(). # INSERT & IntegrityError 18 19 # 2. Model.id doesn't have a default 20 foo = Model(id=1) 21 foo.save(). # UPDATE & INSERT 22 bar = Model(id=1) 23 bar.save(). # UPDATE 19 24 }}}