Changes between Version 1 and Version 2 of Ticket #36064, comment 4


Ignore:
Timestamp:
Jan 7, 2025, 2:48:31 AM (2 days ago)
Author:
Csirmaz Bendegúz

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #36064, comment 4

    v1 v2  
    1111
    1212{{{
     13# 1. Model.id has a default
    1314foo = Model(id=1)
    14 foo.save()
     15foo.save(). # INSERT
    1516bar = 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()
     17bar.save(). # INSERT & IntegrityError
     18
     19# 2. Model.id doesn't have a default
     20foo = Model(id=1)
     21foo.save(). # UPDATE & INSERT
     22bar = Model(id=1)
     23bar.save(). # UPDATE
    1924}}}
Back to Top