﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
25749	Cannot use foreign keys between tables of the same non-default db	muraveill	nobody	"When one has multiple databases, one can use the `using` keyword (or a router class) to query or save entries to a specific db.
Cross-database references (foreign keys) are not supported, but nothing should prevent one from using references between tables of the _same_ db. But it does not work:

    person = People(firstname=firstname, lastname=lastname)
    person.save(using=MY_DB)

    newuser = User(username=username, person=person)
    newuser.save(using=MY_DB)   # to illustrate, but it fails at the previous line

returns 

    Cannot assign ""<People: People object>"": ""People"" instance isn't saved in the database.

Using a router class telling models User and People to always use MY_DB, instead of the 'using' keyword, does not help.
At least there is a point missing in the documentation."	Bug	closed	Database layer (models, ORM)	1.8	Normal	wontfix	foreign key		Unreviewed	0	1	0	0	0	0
