Re: [Django] #13677: ModelFormSet may query wrong database backend

11 views
Skip to first unread message

Django

unread,
Apr 6, 2017, 11:58:15 AM4/6/17
to django-...@googlegroups.com
#13677: ModelFormSet may query wrong database backend
-------------------------------------+-------------------------------------
Reporter: Pierre Chifflier | Owner: David
| Gouldin
Type: Bug | Status: closed
Component: Forms | Version: 1.2
Severity: Normal | Resolution:
| worksforme
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 Tobias Kunze):

* cc: rixx@… (added)
* needs_better_patch: 1 => 0
* has_patch: 1 => 0
* status: new => closed
* resolution: => worksforme


Comment:

I tried to build a ModelFormSet that uses the alternative database, and as
long as you specify for related objects to use the alternative database,
too, the validation is successful. (If you forget to specify the second
database, it throws a very explicit error stating that this model relation
is not possible).

My test case is avaliable here: https://github.com/rixx/django_ticket13667
- please provide a failing example if you want to reopen this ticket.

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

Django

unread,
Apr 6, 2017, 12:16:39 PM4/6/17
to django-...@googlegroups.com
#13677: ModelFormSet may query wrong database backend
-------------------------------------+-------------------------------------
Reporter: Pierre Chifflier | Owner: David
| Gouldin
Type: Bug | Status: closed
Component: Forms | Version: 1.2
Severity: Normal | Resolution:
| worksforme
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 Tim Graham):

Just to be sure, could you clarify what the mistake is in the test in the
patch attached to the ticket (13677.diff​)?

--
Ticket URL: <https://code.djangoproject.com/ticket/13677#comment:14>

Django

unread,
Apr 7, 2017, 7:20:32 AM4/7/17
to django-...@googlegroups.com
#13677: ModelFormSet may query wrong database backend
-------------------------------------+-------------------------------------
Reporter: Pierre Chifflier | Owner: David
| Gouldin
Type: Bug | Status: new

Component: Forms | Version: 1.2
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 Tobias Kunze):

* status: closed => new
* has_patch: 0 => 1
* resolution: worksforme =>


Comment:

I'm sorry: I made a mistake in reproducing the issue and porting the patch
to current Django. After porting the patch I can confirm that the
regression test is valid. I'm not quite sure the implementation is what we
want, but I'll push it and we can discuss the PR.

--
Ticket URL: <https://code.djangoproject.com/ticket/13677#comment:15>

Django

unread,
Apr 7, 2017, 7:20:53 AM4/7/17
to django-...@googlegroups.com
#13677: ModelFormSet may query wrong database backend
----------------------------------+----------------------------------------
Reporter: Pierre Chifflier | Owner: Tobias Kunze
Type: Bug | Status: assigned

Component: Forms | Version: 1.2
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 Tobias Kunze):

* status: new => assigned
* owner: David Gouldin => Tobias Kunze


--
Ticket URL: <https://code.djangoproject.com/ticket/13677#comment:16>

Django

unread,
Jun 7, 2017, 4:22:53 PM6/7/17
to django-...@googlegroups.com
#13677: ModelFormSet may query wrong database backend
----------------------------------+----------------------------------------
Reporter: Pierre Chifflier | Owner: Tobias Kunze
Type: Bug | Status: assigned
Component: Forms | Version: 1.2
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 Tim Graham):

* needs_better_patch: 0 => 1


Comment:

I left some comments for improvement on the PR.

--
Ticket URL: <https://code.djangoproject.com/ticket/13677#comment:17>

Django

unread,
Apr 15, 2019, 1:54:56 PM4/15/19
to django-...@googlegroups.com
#13677: ModelFormSet may query wrong database backend
----------------------------------+----------------------------------------
Reporter: Pierre Chifflier | Owner: Tobias Kunze
Type: Bug | Status: assigned
Component: Forms | Version: 1.2
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 Tobias Kunze):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/13677#comment:18>

Django

unread,
Apr 16, 2019, 5:18:44 PM4/16/19
to django-...@googlegroups.com
#13677: ModelFormSet may query wrong database backend
----------------------------------+----------------------------------------
Reporter: Pierre Chifflier | Owner: Tobias Kunze
Type: Bug | Status: assigned
Component: Forms | Version: master

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 Tobias Kunze):

* version: 1.2 => master


--
Ticket URL: <https://code.djangoproject.com/ticket/13677#comment:19>

Django

unread,
Jun 20, 2019, 9:11:28 AM6/20/19
to django-...@googlegroups.com
#13677: ModelFormSet may query wrong database backend
----------------------------------+----------------------------------------
Reporter: Pierre Chifflier | Owner: Tobias Kunze
Type: Bug | Status: assigned
Component: Forms | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1

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

* needs_better_patch: 0 => 1

* needs_tests: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/13677#comment:20>

Reply all
Reply to author
Forward
0 new messages