Re: [Django] #33582: loaddata fails on non-default database when natural keys uses foreign keys.

30 views
Skip to first unread message

Django

unread,
Mar 18, 2022, 6:41:28 AM3/18/22
to django-...@googlegroups.com
#33582: loaddata fails on non-default database when natural keys uses foreign keys.
-------------------------------------+-------------------------------------
Reporter: François Granade | Owner: François
| Granade
Type: Bug | Status: assigned
Component: Core | Version: 4.0
(Serialization) |
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 François Granade):

* owner: nobody => François Granade
* status: new => assigned


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

Django

unread,
Mar 18, 2022, 6:51:15 AM3/18/22
to django-...@googlegroups.com
#33582: loaddata fails on non-default database when natural keys uses foreign keys.
-------------------------------------+-------------------------------------
Reporter: François Granade | Owner: François
| Granade
Type: Bug | Status: assigned
Component: Core | Version: 4.0
(Serialization) |
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 François Granade):

Proposed patch in https://github.com/django/django/pull/15525

I used `Model.from_db` rather than accessing the private `Model._state`
field, seems cleaner

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

Django

unread,
Mar 18, 2022, 6:56:25 AM3/18/22
to django-...@googlegroups.com
#33582: loaddata fails on non-default database when natural keys uses foreign keys.
-------------------------------------+-------------------------------------
Reporter: François Granade | Owner: François
| Granade
Type: Bug | Status: assigned
Component: Core | Version: 4.0
(Serialization) |
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 François Granade):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/33582#comment:7>

Django

unread,
Mar 18, 2022, 7:51:33 AM3/18/22
to django-...@googlegroups.com
#33582: loaddata fails on non-default database when natural keys uses foreign keys.
-------------------------------------+-------------------------------------
Reporter: François Granade | Owner: François
| Granade
Type: Bug | Status: assigned
Component: Core | Version: 4.0
(Serialization) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/33582#comment:8>

Django

unread,
Mar 18, 2022, 8:36:31 AM3/18/22
to django-...@googlegroups.com
#33582: loaddata fails on non-default database when natural keys uses foreign keys.
-------------------------------------+-------------------------------------
Reporter: François Granade | Owner: François
| Granade
Type: Bug | Status: assigned
Component: Core | Version: 4.0
(Serialization) |
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):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/33582#comment:9>

Django

unread,
Mar 19, 2022, 10:40:03 AM3/19/22
to django-...@googlegroups.com
#33582: loaddata fails on non-default database when natural keys uses foreign keys.
-------------------------------------+-------------------------------------
Reporter: François Granade | Owner: François
| Granade
Type: Bug | Status: closed

Component: Core | Version: 4.0
(Serialization) |
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:"4b8e4f506079419c7995107fad46416ee5add951" 4b8e4f50]:
{{{
#!CommitTicketReference repository=""
revision="4b8e4f506079419c7995107fad46416ee5add951"
Fixed #33582 -- Fixed deserializing natural keys with foreing key
dependencies in a multiple database setup.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33582#comment:10>

Reply all
Reply to author
Forward
0 new messages