﻿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
26892	Add documentation about db_constraint for FK and M2M in Multiple Databases section	Timothée Mazzucotelli	nobody	"Working on a project that uses several databases, I have searched for a long time the best way to have ""fake"" or ""cross-db"" foreign keys between tables that are not on the same database.

I was very surprised when I recently heard about the db_constraint attribute in model fields ForeignKey and ManyToManyField, and wondered why I have found so many ugly hacks before this very Django feature.

Documentation in the Multiple Databases section was very useful, but it would have been a lot more if db_constraint was mentioned in it. And a link back to Multiple Databases from ForeignKey and ManyToManyField db_constraint in model fields reference would also be great.

In don't know when db_constraint appeared but this modification should of course apply to each concerned version of Django (I know 1.8 and following are).

https://docs.djangoproject.com/en/1.9/topics/db/multi-db/
https://docs.djangoproject.com/en/1.9/ref/models/fields/#django.db.models.ForeignKey.db_constraint
https://docs.djangoproject.com/en/1.9/ref/models/fields/#django.db.models.ManyToManyField.db_constraint"	Cleanup/optimization	closed	Documentation	1.9	Normal	invalid	fk m2m db_constraint doc	timothee.mazzucotelli@…	Unreviewed	0	0	0	0	1	0
