Ticket #2195: generic_relation_modeltests_spelling.diff
File generic_relation_modeltests_spelling.diff, 1.4 KB (added by , 18 years ago) |
---|
-
trunk/tests/modeltests/generic_relations/models.py
5 5 content-type/object-id field. A generic foreign key can point to any object, 6 6 be it animal, vegetable, or mineral. 7 7 8 The can nonical example is tags (although this example implementation is *far*8 The canonical example is tags (although this example implementation is *far* 9 9 from complete). 10 10 """ 11 11 … … 85 85 <Vegetable: Bacon> 86 86 87 87 # Recall that the Mineral class doesn't have an explicit GenericRelation 88 # defined. That's OK since you can create TaggedItems explicit ally.88 # defined. That's OK since you can create TaggedItems explicitly. 89 89 >>> tag1 = TaggedItem(content_object=quartz, tag="shiny") 90 90 >>> tag2 = TaggedItem(content_object=quartz, tag="clearish") 91 91 >>> tag1.save() 92 92 >>> tag2.save() 93 93 94 # However, not having the conv ience takes a small toll when it comes94 # However, not having the convenience takes a small toll when it comes 95 95 # to do lookups 96 96 >>> from django.contrib.contenttypes.models import ContentType 97 97 >>> ctype = ContentType.objects.get_for_model(quartz) … … 105 105 [<TaggedItem: shiny>] 106 106 >>> TaggedItem.objects.filter(content_type__pk=ctype.id, object_id=quartz.id) 107 107 [<TaggedItem: clearish>] 108 """ 109 No newline at end of file 108 """