summaryrefslogtreecommitdiff
path: root/docs/ref
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/ref
parent4cccb85e292fea01b3459cd97d751ed35179a7b7 (diff)
Added a ManyToManyField(db_constraint=False) option, this allows not creating constraints on the intermediary models.
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/models/fields.txt14
1 files changed, 14 insertions, 0 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``