summaryrefslogtreecommitdiff
path: root/docs/ref/models
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2009-04-03 18:30:54 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2009-04-03 18:30:54 +0000
commitc6c25adf6d9f71ea11f61392f6f3d221f01e5216 (patch)
treedfa307cf0cced0495cc7d188aef437bdbca46cdc /docs/ref/models
parentd2a8bc5b40bdceb57d2e23e75ea81ba495e6bbb5 (diff)
Fixed a whole bunch of small docs typos, errors, and ommissions.
Fixes #8358, #8396, #8724, #9043, #9128, #9247, #9267, #9267, #9375, #9409, #9414, #9416, #9446, #9454, #9464, #9503, #9518, #9533, #9657, #9658, #9683, #9733, #9771, #9835, #9836, #9837, #9897, #9906, #9912, #9945, #9986, #9992, #10055, #10084, #10091, #10145, #10245, #10257, #10309, #10358, #10359, #10424, #10426, #10508, #10531, #10551, #10635, #10637, #10656, #10658, #10690, #10699, #19528. Thanks to all the respective authors of those tickets. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10371 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/ref/models')
-rw-r--r--docs/ref/models/fields.txt18
-rw-r--r--docs/ref/models/instances.txt12
-rw-r--r--docs/ref/models/relations.txt27
3 files changed, 46 insertions, 11 deletions
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt
index 42a44bf920..6630b7bc26 100644
--- a/docs/ref/models/fields.txt
+++ b/docs/ref/models/fields.txt
@@ -870,11 +870,11 @@ the model is related. This works exactly the same as it does for
Behind the scenes, Django creates an intermediary join table to represent the
many-to-many relationship. By default, this table name is generated using the
names of the two tables being joined. Since some databases don't support table
-names above a certain length (often 32 characters), these table names will be
-automatically truncated to 32 characters and a uniqueness hash will be used.
-This means you might see table names like ``author_books_9cdf4``; this is
-perfectly normal. You can manually provide the name of the join table using
-the :attr:`~ManyToManyField.db_table` option.
+names above a certain length, these table names will be automatically
+truncated to 64 characters and a uniqueness hash will be used. This means you
+might see table names like ``author_books_9cdf4``; this is perfectly normal.
+You can manually provide the name of the join table using the
+:attr:`~ManyToManyField.db_table` option.
.. _manytomany-arguments:
@@ -889,8 +889,9 @@ that control how the relationship functions.
Same as :attr:`ForeignKey.limit_choices_to`.
- ``limit_choices_to`` has no effect when used on a ``ManyToManyField`` with
- an intermediate table.
+ ``limit_choices_to`` has no effect when used on a ``ManyToManyField`` with a
+ custom intermediate table specified using the
+ :attr:`~ManyToManyField.through` paramter.
.. attribute:: ManyToManyField.symmetrical
@@ -920,7 +921,8 @@ that control how the relationship functions.
use.
The most common use for this option is when you want to associate
- :ref:`extra data with a many-to-many relationship <intermediary-manytomany>`.
+ :ref:`extra data with a many-to-many relationship
+ <intermediary-manytomany>`.
.. attribute:: ManyToManyField.db_table
diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt
index b2b04e04d5..c6509ece3d 100644
--- a/docs/ref/models/instances.txt
+++ b/docs/ref/models/instances.txt
@@ -188,6 +188,18 @@ almost always do the right thing and trying to override that will lead to
errors that are difficult to track down. This feature is for advanced use
only.
+Deleting objects
+================
+
+.. method:: Model.delete()
+
+ Issues a SQL ``DELETE`` for the object. This only deletes the object in the
+ database; the Python instance will still be around, and will still have data
+ in its fields.
+
+ For more details, including how to delete objects in bulk, see
+ :ref:`topics-db-queries-delete`.
+
.. _model-instance-methods:
Other model instance methods
diff --git a/docs/ref/models/relations.txt b/docs/ref/models/relations.txt
index 9aec52c2b5..2c5be28a72 100644
--- a/docs/ref/models/relations.txt
+++ b/docs/ref/models/relations.txt
@@ -4,11 +4,32 @@
Related objects reference
=========================
-Extra methods on managers when used in a ForeignKey context
-===========================================================
-
.. currentmodule:: django.db.models
+This document describes extra methods available on managers when used in a one-to-many or many-to-many related context. This happens in two cases:
+
+ * The "other side" of a ``ForeignKey`` relation. That is::
+
+ class Reporter(models.Model):
+ ...
+
+ class Article(models.Model):
+ reporter = models.ForeignKey(Reporter)
+
+ In the above example, the methods below will be available on
+ the manager ``reporter.article_set``.
+
+ * Both sides of a ``ManyToManyField`` relation::
+
+ class Topping(models.Model):
+ ...
+
+ class Pizza(models.Model):
+ toppings = models.ManyToManyField(Topping)
+
+ In this example, the methods below will be available both on
+ ``topping.pizza_set`` and on ``pizza.toppings``.
+
.. method:: QuerySet.add(obj1, [obj2, ...])
Adds the specified model objects to the related object set.