Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed some small typos in generic_relations model tests

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3156 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit ed6d7285dd4c5fa61fd6aea07fb3d372feb3fa6b 1 parent 1a1b1aa
Adrian Holovaty authored June 19, 2006
14  tests/modeltests/generic_relations/models.py
@@ -64,7 +64,7 @@ def __str__(self):
64 64
 ...     o.save()
65 65
 
66 66
 # Objects with declared GenericRelations can be tagged directly -- the API
67  
-# mimics the many-to-many API
  67
+# mimics the many-to-many API.
68 68
 >>> lion.tags.create(tag="yellow")
69 69
 <TaggedItem: yellow>
70 70
 >>> lion.tags.create(tag="hairy")
@@ -79,30 +79,30 @@ def __str__(self):
79 79
 >>> bacon.tags.all()
80 80
 [<TaggedItem: fatty>, <TaggedItem: salty>]
81 81
 
82  
-# You can easily access the content object like a foreign key
  82
+# You can easily access the content object like a foreign key.
83 83
 >>> t = TaggedItem.objects.get(tag="salty")
84 84
 >>> t.content_object
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 explicitally.
  88
+# defined. That's OK, because 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 convience takes a small toll when it comes
95  
-# to do lookups
  94
+# However, excluding GenericRelations means your lookups have to be a bit more
  95
+# explicit.
96 96
 >>> from django.contrib.contenttypes.models import ContentType
97 97
 >>> ctype = ContentType.objects.get_for_model(quartz)
98 98
 >>> TaggedItem.objects.filter(content_type__pk=ctype.id, object_id=quartz.id)
99 99
 [<TaggedItem: clearish>, <TaggedItem: shiny>]
100 100
 
101  
-# You can set a generic foreign key in the way you'd expect
  101
+# You can set a generic foreign key in the way you'd expect.
102 102
 >>> tag1.content_object = platypus
103 103
 >>> tag1.save()
104 104
 >>> platypus.tags.all()
105 105
 [<TaggedItem: shiny>]
106 106
 >>> TaggedItem.objects.filter(content_type__pk=ctype.id, object_id=quartz.id)
107 107
 [<TaggedItem: clearish>]
108  
-"""
  108
+"""

0 notes on commit ed6d728

Please sign in to comment.
Something went wrong with that request. Please try again.