diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2005-07-20 22:55:01 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2005-07-20 22:55:01 +0000 |
| commit | bc5359f754f7afe6b4aa1eb4972c32a508b7fb55 (patch) | |
| tree | d7454e6a2c4ddc3ac0731543ed45a73f9e65d399 /docs/model-api.txt | |
| parent | 895d23267115412ab7344ce7668adb1efa7f8e00 (diff) | |
Added optional rel_name parameter to ManyToManyField, which makes it possible to many-to-many-relate a single model to another model more than once. Also updated the model docs to reflect this
git-svn-id: http://code.djangoproject.com/svn/django/trunk@257 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/model-api.txt')
| -rw-r--r-- | docs/model-api.txt | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/docs/model-api.txt b/docs/model-api.txt index 0011414eed..e52ca8b43d 100644 --- a/docs/model-api.txt +++ b/docs/model-api.txt @@ -455,12 +455,17 @@ Field Types Many-to-many relations are a bit different from other fields. First, they aren't actually a field per se, because they use a intermediary join table. - Second, they don't take any of the same options as the rest of the fields. - The only arguments taken are: + Second, they don't take the same options as the rest of the fields. The + only arguments taken are: ======================= ============================================================ Argument Description ======================= ============================================================ + ``rel_name`` Use this if you have more than one + ``ManyToOneField`` s in the same model that relate + to the same model. Django will use ``rel_name`` in + the generated API. + ``related_name`` See the description of ``related_name`` in ``ManyToOneField``, above. @@ -471,7 +476,19 @@ Field Types should the interface be stacked horizontally or vertically). - ``limit_choices_to`` See the description under ``ManyToOneField``, above. + ``limit_choices_to`` See the description under ``ManyToOneField`` above. + + ``name`` An alphanumeric name for the relationship. If this + isn't provided, Django uses the ``module_name`` of + the related object. + + This is only really useful when you have a single + object that relates to the same object more than + once. + + ``verbose_name`` A human-readable name for the object, singular. If + this isn't provided, Django uses the + ``verbose_name`` for the related object. ======================= ============================================================ ``NullBooleanField`` |
