#36064: save() behavior for new model instance with default primary key does not
apply to CompositePrimaryKey
-------------------------------------+-------------------------------------
     Reporter:  Jacob Walls          |                    Owner:  (none)
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  dev
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by Csirmaz Bendegúz):

 Thanks Jacob!

 || n || default || obj.save() || conflict ||
 || 1 || yes  || insert || IntegrityError ||
 || 2 || no || update & insert || update ||

 1. If pk has a ''default'' or ''db_default'', saving a new object with a
 conflicting pk attempts an insert and raises an IntegrityError
 2. If pk doesn't have a ''default'' or ''db_default'', saving a new object
 with a conflicting pk attempts an update (if no rows affected attempts an
 insert)

 Is that correct?
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36064#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/010701943fe9c83c-49ea48a7-9e68-49c5-807d-38b4269e2e18-000000%40eu-central-1.amazonses.com.

Reply via email to