#36550: AssertionError raised when bulk creation model with primary key set via
pre_save (e.g. auto_now_add) on databases with
can_return_columns_from_insert
-------------------------------------+-------------------------------------
     Reporter:  Will-Ruddick         |                    Owner:  (none)
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  dev
  (models, ORM)                      |
     Severity:  Normal               |               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 Jason Hall):

 Then would we want to modify the test logic and add
 @skipUnlessDBFeature("can_return_columns_from_insert")?

 As far as a fix I was thinking we could ensure Field.pre_save() is applied
 before partitioning objects into with_pk and without_pk, adjust the
 classification to check completeness of all PK fields (including composite
 keys), and only request returning_fields when at least one object is
 missing a pk (skip requesting PKs when they're all known locally).  Would
 that be acceptable?
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36550#comment:9>
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/01070198a9108bd3-f9a51cfc-9b28-4238-84fb-59a5509b218e-000000%40eu-central-1.amazonses.com.

Reply via email to