diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2008-07-19 02:46:12 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2008-07-19 02:46:12 +0000 |
| commit | b5b0febc4cd5ad51aeb1ef7b37aaca6a7632519d (patch) | |
| tree | 277d17d3f82f8720c06d7782aced50958ea39ed0 /docs | |
| parent | 825622d912aa8e87ddcda1af65edef9bb765e389 (diff) | |
Fixed #7785 -- Added a note in the contenttypes documentation that GenericRelations must share a common field type for primary keys. Thanks to Rudolph for the suggestion and initial draft.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7976 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/contenttypes.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/contenttypes.txt b/docs/contenttypes.txt index 51ca8f0198..96e3b0939c 100644 --- a/docs/contenttypes.txt +++ b/docs/contenttypes.txt @@ -205,6 +205,11 @@ model. There are three parts to setting up a ``GenericForeignKey``: models you'll be relating to. (For most models, this means an ``IntegerField`` or ``PositiveIntegerField``.) + This field must be of the same type as the primary key of the models + that will be involved in the generic relation. For example, if you use + ``IntegerField``, you won't be able to form a generic relation with a + model that uses a ``CharField`` as a primary key. + 3. Give your model a ``GenericForeignKey``, and pass it the names of the two fields described above. If these fields are named "content_type" and "object_id", you can omit this -- those are the |
