Opened 6 years ago

Closed 12 months ago

Last modified 12 months ago

#13637 closed Bug (fixed)

Generic Relations don't work correctly on a non-default database alias

Reported by: Andrew Godwin Owned by:
Component: contrib.contenttypes Version: master
Severity: Normal Keywords: multi-db, truncation
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Specifically, line 195 of contrib.contenttypes.generic uses django.db.connection directly - this needs to be fixed.

It looks like it will need connection-choosing pushed inside the RelatedManager provided. I'm going to work on fixing this - just noting it as a separate ticket to #13528 (I found it while fixing that, but it's a separate issue, pretty much, it affects quoting as well as table name truncation).

Attachments (1)

django-ct-dbs.diff (4.8 KB) - added by Alex Gaynor 6 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 6 years ago by Andrew Godwin

Needs documentation: unset
Needs tests: unset
Owner: changed from nobody to Andrew Godwin
Patch needs improvement: unset
Status: newassigned
Triage Stage: UnreviewedAccepted
Version: 1.1SVN

Changed 6 years ago by Alex Gaynor

Attachment: django-ct-dbs.diff added

comment:2 Changed 6 years ago by Julien Phalip

Severity: Normal
Type: Bug

comment:3 Changed 6 years ago by anonymous

Component: Database layer (models, ORM)contrib.contenttypes

comment:4 Changed 5 years ago by Aymeric Augustin

UI/UX: unset

Change UI/UX from NULL to False.

comment:5 Changed 5 years ago by Aymeric Augustin

Easy pickings: unset

Change Easy pickings from NULL to False.

comment:6 Changed 3 years ago by Andrew Godwin

Owner: Andrew Godwin deleted
Status: assignednew

comment:7 Changed 12 months ago by Tim Graham

Has patch: set

It looks like the code in question is unused: PR to remove it.

comment:8 Changed 12 months ago by Tim Graham <timograham@…>

In 37a5a36:

Refs #13637 -- Removed unused code in GenericRelatedObjectManager

Appears unused since 585b7acaa359fc1df07269c1a4b4756bdb6703f7.

comment:9 Changed 12 months ago by Tim Graham

Resolution: fixed
Status: newclosed

comment:10 Changed 12 months ago by Tim Graham <timograham@…>

In aebe780:

[1.9.x] Refs #13637 -- Removed unused code in GenericRelatedObjectManager

Appears unused since 585b7acaa359fc1df07269c1a4b4756bdb6703f7.

Backport of 37a5a363215d7c0360ff0a8f57856d373e8c1629 from master

Note: See TracTickets for help on using tickets.
Back to Top