Ticket #8909: ref-contrib-contenttypes.diff
File ref-contrib-contenttypes.diff, 641 bytes (added by , 16 years ago) |
---|
-
docs/ref/contrib/contenttypes.txt
305 305 306 306 If you don't add the reverse relationship, you can do the lookup manually:: 307 307 308 >>> b = Bookmark.objects.get(url='http://www.djangoproject.com/ )308 >>> b = Bookmark.objects.get(url='http://www.djangoproject.com/') 309 309 >>> bookmark_type = ContentType.objects.get_for_model(b) 310 310 >>> TaggedItem.objects.filter(content_type__pk=bookmark_type.id, 311 311 ... object_id=b.id)