Code

Ticket #10367: 10367-genericrelation-r10591.diff

File 10367-genericrelation-r10591.diff, 684 bytes (added by gsong, 5 years ago)

Fixed incorrect GenericRelation example.

Line 
1Index: docs/ref/contrib/contenttypes.txt
2===================================================================
3--- docs/ref/contrib/contenttypes.txt   (revision 10592)
4+++ docs/ref/contrib/contenttypes.txt   (working copy)
5@@ -313,7 +313,7 @@
6 ``object_primary_key`` to create its generic foreign key, then a
7 ``GenericRelation`` back to it would need to be defined like so::
8 
9-    tags = generic.GenericRelation('content_type_fk', 'object_primary_key')
10+    tags = generic.GenericRelation(TaggedItem, content_type_field='content_type_fk', object_id_field='object_primary_key')
11 
12 Of course, if you don't add the reverse relationship, you can do the
13 same types of lookups manually::