Commit 949881c0 by Raphael Lullis

Updating README to reflect changes in class names.

parent fd97cacb
......@@ -17,13 +17,13 @@ Let's get everything set up first. You'll need to give **ParsePy** your _Applica
To create a new object of the Parse class _GameScore_:
~~~~~ {python}
>>> gameScore = parse.ParseObject("GameScore")
>>> gameScore = parse.Object("GameScore")
>>> gameScore.score = 1337
>>> gameScore.playerName = "Sean Plott"
>>> gameScore.cheatMode = False
~~~~~
As you can see, we add new properties simply by assigning values to our _ParseObject_'s attributes. Supported data types are any type that can be serialized by JSON and Python's _datetime.datetime_ object. (Binary data and references to other _ParseObject_'s are also supported, as we'll see in a minute.)
As you can see, we add new properties simply by assigning values to our _Object_'s attributes. Supported data types are any type that can be serialized by JSON and Python's _datetime.datetime_ object. (Binary data and references to other _Object_'s are also supported, as we'll see in a minute.)
To save our new object, just call the save() method:
......@@ -55,7 +55,7 @@ That's it! You're ready to start saving data on Parse.
Object Metadata
---------------
The methods objectId(), createdAt(), and updatedAt() return metadata about a _ParseObject_ that cannot be modified through the API:
The methods objectId(), createdAt(), and updatedAt() return metadata about a _Object_ that cannot be modified through the API:
~~~~~ {python}
>>> gameScore.objectId()
......@@ -69,16 +69,16 @@ datetime.datetime(2011, 9, 118, 14, 18, 23, 152000)
Additional Datatypes
--------------------
If we want to store data in a ParseObject, we should wrap it in a ParseBinaryDataWrapper. The ParseBinaryDataWrapper behaves just like a string, and inherits all of _str_'s methods.
If we want to store data in a Object, we should wrap it in a ParseBinaryDataWrapper. The ParseBinaryDataWrapper behaves just like a string, and inherits all of _str_'s methods.
~~~~~ {python}
>>> gameScore.victoryImage = parse.ParseBinaryDataWrapper('\x03\xf3\r\n\xc7\x81\x7fNc ... ')
~~~~~
We can store a reference to another ParseObject by assigning it to an attribute:
We can store a reference to another Object by assigning it to an attribute:
~~~~~ {python}
>>> collectedItem = parse.ParseObject("CollectedItem")
>>> collectedItem = parse.Object("CollectedItem")
>>> collectedItem.type = "Sword"
>>> collectedItem.isAwesome = True
>>> collectedItem.save() # we have to save it before it can be referenced
......@@ -89,7 +89,7 @@ We can store a reference to another ParseObject by assigning it to an attribute:
We can also store geoPoint dataTypes as attributes using the format <code>'POINT(longitude latitude)'</code>, with latitude and longitude as float values
~~~~~ {python}
>>> restaurant = parse.ParseObject("Restaurant")
>>> restaurant = parse.Object("Restaurant")
>>> restaurant.name = "Los Pollos Hermanos"
>>> restaurant.location ="POINT(12.0 -34.45)"
>>> restaurant.save()
......@@ -102,13 +102,13 @@ Querying
To retrieve an object with a Parse class of _GameScore_ and an _objectId_ of _xxwXx9eOec_, run:
~~~~~ {python}
>>> gameScore = parse.ParseQuery("GameScore").get("xxwXx9eOec")
>>> gameScore = parse.ObjectQuery("GameScore").get("xxwXx9eOec")
~~~~~
We can also run more complex queries to retrieve a range of objects. For example, if we want to get a list of _GameScore_ objects with scores between 1000 and 2000 ordered by _playerName_, we would call:
~~~~~ {python}
>>> query = parse.ParseQuery("GameScore")
>>> query = parse.ObjectQuery("GameScore")
>>> query = query.gte("score", 1000).lt("score", 2000).order("playerName")
>>> GameScores = query.fetch()
~~~~~
......
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