[Django] #31277: System check fields.E340 should be relaxed when DATABASE_ROUTERS is present

7 views
Skip to first unread message

Django

unread,
Feb 15, 2020, 7:27:33 PM2/15/20
to django-...@googlegroups.com
#31277: System check fields.E340 should be relaxed when DATABASE_ROUTERS is present
-------------------------------------+-------------------------------------
Reporter: Xavier | Owner: nobody
Francisco |
Type: Bug | Status: new
Component: Core | Version: 3.0
(System checks) | Keywords: database-router,
Severity: Normal | manytomany
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Hey.

On PR https://github.com/django/django/pull/11630, changes were made to
change to allow for multiple models with the same `db_name`. Instead of an
`Error` (`models.E028`), a `Warning` was created to be used in lieu of it,
when `DATABASE_ROUTERS` is present.

The same issue arises, with a different check, when using
`ManyToManyField`, with clashing `db_name`s. The system check in question
is `fields.E340`.

My suggestion would be to do apply the same change for this check, and
raise a `Warning` instead, whenever `DATABASE_ROUTERS` exists.
At this point, the only workaround is silencing the error system check.

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

Django

unread,
Feb 15, 2020, 7:28:27 PM2/15/20
to django-...@googlegroups.com
#31277: System check fields.E340 should be relaxed when DATABASE_ROUTERS is present
-------------------------------------+-------------------------------------
Reporter: Xavier Francisco | Owner: Xavier
| Francisco
Type: Bug | Status: assigned
Component: Core (System | Version: 3.0
checks) |
Severity: Normal | Resolution:
Keywords: database-router, | Triage Stage:
manytomany | Unreviewed
Has patch: 0 | Needs documentation: 0

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

* owner: nobody => Xavier Francisco
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/31277#comment:1>

Django

unread,
Feb 15, 2020, 7:35:44 PM2/15/20
to django-...@googlegroups.com
#31277: System check fields.E340 should be relaxed when DATABASE_ROUTERS is present
-------------------------------------+-------------------------------------
Reporter: Xavier Francisco | Owner: Xavier
| Francisco
Type: Bug | Status: assigned
Component: Core (System | Version: 3.0
checks) |
Severity: Normal | Resolution:
Keywords: database-router, | Triage Stage:
manytomany | Unreviewed
Has patch: 1 | Needs documentation: 0

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

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/31277#comment:2>

Django

unread,
Feb 17, 2020, 2:20:12 AM2/17/20
to django-...@googlegroups.com
#31277: System check fields.E340 should be relaxed when DATABASE_ROUTERS is
present.

-------------------------------------+-------------------------------------
Reporter: Xavier Francisco | Owner: Xavier
| Francisco
Type: Bug | Status: assigned
Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution:
Keywords: database-router, | Triage Stage: Accepted
manytomany |
Has patch: 1 | Needs documentation: 0

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

* version: 3.0 => master
* stage: Unreviewed => Accepted


Comment:

[https://github.com/django/django/pull/12461 PR]

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

Django

unread,
Feb 17, 2020, 3:56:28 AM2/17/20
to django-...@googlegroups.com
#31277: System check fields.E340 should be relaxed when DATABASE_ROUTERS is
present.
-------------------------------------+-------------------------------------
Reporter: Xavier Francisco | Owner: Xavier
| Francisco
Type: Bug | Status: assigned
Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution:
Keywords: database-router, | Triage Stage: Accepted
manytomany |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* needs_better_patch: 0 => 1


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

Django

unread,
Feb 17, 2020, 6:45:35 AM2/17/20
to django-...@googlegroups.com
#31277: System check fields.E340 should be relaxed when DATABASE_ROUTERS is
present.
-------------------------------------+-------------------------------------
Reporter: Xavier Francisco | Owner: Xavier
| Francisco
Type: Bug | Status: assigned
Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution:
Keywords: database-router, | Triage Stage: Ready for
manytomany | checkin
Has patch: 1 | Needs documentation: 0

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

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


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

Django

unread,
Feb 17, 2020, 7:55:06 AM2/17/20
to django-...@googlegroups.com
#31277: System check fields.E340 should be relaxed when DATABASE_ROUTERS is
present.
-------------------------------------+-------------------------------------
Reporter: Xavier Francisco | Owner: Xavier
| Francisco
Type: Bug | Status: closed

Component: Core (System | Version: master
checks) |
Severity: Normal | Resolution: fixed

Keywords: database-router, | Triage Stage: Ready for
manytomany | 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:"86908785076b2bbc31b908781da6b6ad1779b18b" 86908785]:
{{{
#!CommitTicketReference repository=""
revision="86908785076b2bbc31b908781da6b6ad1779b18b"
Fixed #31277 -- Relaxed system check of m2m intermediary tables for
db_table collision when database routers are installed.

Turned the error into a warning when database routers are installed.
}}}

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

Reply all
Reply to author
Forward
0 new messages