Fixed #12837 -- Clarified the naming strategy for m2m intermediate tables. Thanks to Ramiro Morales for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12516 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee 2010-02-23 13:21:07 +00:00
parent c306b78150
commit a555df4c06
1 changed files with 9 additions and 8 deletions

View File

@ -913,12 +913,13 @@ the model is related. This works exactly the same as it does for
Database Representation Database Representation
~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
Behind the scenes, Django creates an intermediary join table to represent the Behind the scenes, Django creates an intermediary join table to
many-to-many relationship. By default, this table name is generated using the represent the many-to-many relationship. By default, this table name
names of the two tables being joined. Since some databases don't support table is generated using the name of the many-to-many field and the model
names above a certain length, these table names will be automatically that contains it. Since some databases don't support table names above
truncated to 64 characters and a uniqueness hash will be used. This means you a certain length, these table names will be automatically truncated to
might see table names like ``author_books_9cdf4``; this is perfectly normal. 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 You can manually provide the name of the join table using the
:attr:`~ManyToManyField.db_table` option. :attr:`~ManyToManyField.db_table` option.