Re: [Django] #34698: Allow returning IDs in QuerySet.bulk_create() when updating conflicts.

3 views
Skip to first unread message

Django

unread,
Jul 7, 2023, 3:24:11 AM7/7/23
to django-...@googlegroups.com
#34698: Allow returning IDs in QuerySet.bulk_create() when updating conflicts.
-------------------------------------+-------------------------------------
Reporter: Thomas C | Owner: Thomas C
Type: New feature | Status: assigned
Component: Database layer | Version: 4.2
(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
-------------------------------------+-------------------------------------
Changes (by Thomas C):

* owner: nobody => Thomas C
* status: new => assigned


Comment:

Sure I will.

--
Ticket URL: <https://code.djangoproject.com/ticket/34698#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 7, 2023, 5:15:14 AM7/7/23
to django-...@googlegroups.com
#34698: Allow returning IDs in QuerySet.bulk_create() when updating conflicts.
-------------------------------------+-------------------------------------
Reporter: Thomas C | Owner: Thomas C
Type: New feature | Status: assigned
Component: Database layer | Version: 4.2
(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 Mariusz Felisiak):

Replying to [comment:2 Thomas C]:
> Sure I will.

Thanks. About tests, it should be enough to add some assertions to
existing tests: `_test_update_conflicts_two_fields()`,
`test_update_conflicts_unique_fields_pk()`,
`_test_update_conflicts_unique_two_fields()`, `_test_update_conflicts()`,
and `test_update_conflicts_unique_fields_update_fields_db_column()` when
`connection.features.can_return_rows_from_bulk_insert` is True.

--
Ticket URL: <https://code.djangoproject.com/ticket/34698#comment:3>

Django

unread,
Jul 7, 2023, 7:02:06 AM7/7/23
to django-...@googlegroups.com
#34698: Allow returning IDs in QuerySet.bulk_create() when updating conflicts.
-------------------------------------+-------------------------------------
Reporter: Thomas C | Owner: Thomas C
Type: New feature | Status: assigned
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Thomas C):

* has_patch: 0 => 1


Comment:

See https://github.com/django/django/pull/17051

--
Ticket URL: <https://code.djangoproject.com/ticket/34698#comment:4>

Django

unread,
Jul 10, 2023, 7:17:50 AM7/10/23
to django-...@googlegroups.com
#34698: Allow returning IDs in QuerySet.bulk_create() when updating conflicts.
-------------------------------------+-------------------------------------
Reporter: Thomas C | Owner: Thomas C
Type: New feature | Status: assigned
Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/34698#comment:5>

Django

unread,
Jul 10, 2023, 1:28:16 PM7/10/23
to django-...@googlegroups.com
#34698: Allow returning IDs in QuerySet.bulk_create() when updating conflicts.
-------------------------------------+-------------------------------------
Reporter: Thomas C | Owner: Thomas C
Type: New feature | Status: closed

Component: Database layer | Version: 4.2
(models, ORM) |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"89c7454dbdae3e0df6d96aa6132205d05e4a9b3d" 89c7454]:
{{{
#!CommitTicketReference repository=""
revision="89c7454dbdae3e0df6d96aa6132205d05e4a9b3d"
Fixed #34698 -- Made QuerySet.bulk_create() retrieve primary keys when
updating conflicts.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34698#comment:6>

Reply all
Reply to author
Forward
0 new messages