summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@rd.io>2013-03-07 11:24:51 -0800
committerAlex Gaynor <alex.gaynor@rd.io>2013-03-07 11:24:51 -0800
commitbbbd698c7a4dd19e6394660bece7e6e907b0a824 (patch)
tree24eb0a744ad8214976fa01502d85ca47d8446c75 /docs
parent4cccb85e292fea01b3459cd97d751ed35179a7b7 (diff)
Added a ManyToManyField(db_constraint=False) option, this allows not creating constraints on the intermediary models.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/fields.txt14
-rw-r--r--docs/releases/1.6.txt4
2 files changed, 16 insertions, 2 deletions
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt
index 1dbc8c3998..1b80196183 100644
--- a/docs/ref/models/fields.txt
+++ b/docs/ref/models/fields.txt
@@ -1227,6 +1227,20 @@ that control how the relationship functions.
the table for the model defining the relationship and the name of the field
itself.
+.. attribute:: ManyToManyField.db_constraint
+
+ Controls whether or not constraints should be created in the database for
+ the foreign keys in the intermediary table. The default is ``True``, and
+ that's almost certainly what you want; setting this to ``False`` can be
+ very bad for data integrity. That said, here are some scenarios where you
+ might want to do this:
+
+ * You have legacy data that is not valid.
+ * You're sharding your database.
+
+ It is an error to pass both ``db_constraint`` and ``through``.
+
+
.. _ref-onetoone:
``OneToOneField``
diff --git a/docs/releases/1.6.txt b/docs/releases/1.6.txt
index 599da6847c..81b1e48d25 100644
--- a/docs/releases/1.6.txt
+++ b/docs/releases/1.6.txt
@@ -113,8 +113,8 @@ Minor features
* The ``MemcachedCache`` cache backend now uses the latest :mod:`pickle`
protocol available.
-* Added the :attr:`django.db.models.ForeignKey.db_constraint`
- option.
+* Added the :attr:`django.db.models.ForeignKey.db_constraint` and
+ :attr:`django.db.models.ManyToManyField.db_constraint` options.
* The jQuery library embedded in the admin has been upgraded to version 1.9.1.