diff options
| author | Ramiro Morales <cramm0@gmail.com> | 2013-02-01 21:33:39 -0300 |
|---|---|---|
| committer | Ramiro Morales <cramm0@gmail.com> | 2013-02-01 23:30:50 -0300 |
| commit | 5f7eecd09af8d69722d483b73b5ac3a086ad0e42 (patch) | |
| tree | 51da16b47983590ef5a6a3049b63f00ae2461341 /docs/ref | |
| parent | 1ee40f2141b0cffd4be69fbe5e6a8c526bcf6243 (diff) | |
Small generic FK docs tweaks.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/contrib/contenttypes.txt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/docs/ref/contrib/contenttypes.txt b/docs/ref/contrib/contenttypes.txt index 34a2fd7f78..fb85653ce8 100644 --- a/docs/ref/contrib/contenttypes.txt +++ b/docs/ref/contrib/contenttypes.txt @@ -277,7 +277,7 @@ A normal :class:`~django.db.models.ForeignKey` can only "point to" one other model, which means that if the ``TaggedItem`` model used a :class:`~django.db.models.ForeignKey` it would have to choose one and only one model to store tags for. The contenttypes -application provides a special field type which +application provides a special field type (``GenericForeignKey``) which works around this and allows the relationship to be with any model: @@ -287,7 +287,8 @@ model: :class:`~django.contrib.contenttypes.generic.GenericForeignKey`: 1. Give your model a :class:`~django.db.models.ForeignKey` - to :class:`~django.contrib.contenttypes.models.ContentType`. + to :class:`~django.contrib.contenttypes.models.ContentType`. The usual + name for this field is "content_type". 2. Give your model a field that can store primary key values from the models you'll be relating to. For most models, this means a |
