Commit bcb8692b by johnk

Incorporated suggestions

Changed some comments. Rewrote part of the documentation.
parent fa21c7df
......@@ -373,9 +373,12 @@ for post in posts_by_joe:
Relations
---------
You can associate multiple objects to a single object
by using a Relation.
You then query against this subset of objects.
A Relation is field that contains references to multiple objects.
You can query this subset of objects.
For example, if we have Game and GameScore classes, and one game
can have multiple GameScores, you can use relations to associate
those GameScores with a Game.
~~~~~ {python}
game = Game(name="3-way Battle")
......@@ -388,7 +391,7 @@ relation.add([score1, score2, score3])
~~~~~
A Game gets added, three GameScores get added, and three relations
are created associating the scores with the game.
are created associating the GameScores with the Game.
To retreive the related scores for a game, you use query() to get a
Queryset for the relation.
......@@ -399,7 +402,6 @@ for gamescore in scores:
print gamescore.player_name, gamescore.score
~~~~~
The Queryset can be manipulated like any Queryset.
The query is limited to the objects previously added to the
relation.
......
......@@ -145,12 +145,12 @@ class Relation(ParseType):
queries until we know what classes are on both sides
of the relation.
If it's called via from_native, then, a later call to
If it's called via from_native, then a later call to
with_parent() provides parent information.
If it's called as Relation(), the relatedClassName is
discovered either on the first added object, or
by probing the server to retrieve an object.
by querying the server to retrieve the schema.
"""
# Name of the key on the parent object.
self.key = None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment