Commit 362d8978 by Paul Kastner

more README updates

parent 243b6a58
...@@ -23,7 +23,7 @@ To create a new object of the Parse class _GameScore_: ...@@ -23,7 +23,7 @@ To create a new object of the Parse class _GameScore_:
>>> gameScore.cheatMode = False >>> gameScore.cheatMode = False
~~~~~ ~~~~~
As you can see, we can add new properties simply by assining values to our _ParseObject_'s attributes. Supported data types are any type that can be serialized by JSON, the and datetime.datetime object. (Binary data and references to other _ParseObject_'s is also supported, as we'll see in a minute.) As you can see, we add new properties simply by assining 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 is also supported, as we'll see in a minute.)
To save it, just call the save() method: To save it, just call the save() method:
...@@ -36,6 +36,16 @@ If we want to make an update, just call save() again afterwards to send the chan ...@@ -36,6 +36,16 @@ If we want to make an update, just call save() again afterwards to send the chan
~~~~~ {python} ~~~~~ {python}
>>> gameScore.score = 2061 >>> gameScore.score = 2061
>>> gameScore.save() >>> gameScore.save()
~~~~~
That's it! You're ready to start saving data to Parse.
Object Metadata
---------------
The methods objectId(), createdAt(), and updatedAt() return metadata about a _ParseObject_ that cannot be modified through the API:
~~~~~ {python}
>>> gameScore.objectId() >>> gameScore.objectId()
'xxwXx9eOec' 'xxwXx9eOec'
>>> gameScore.createdAt() >>> gameScore.createdAt()
...@@ -44,7 +54,8 @@ datetime.datetime(2011, 9, 16, 21, 51, 36, 784000) ...@@ -44,7 +54,8 @@ datetime.datetime(2011, 9, 16, 21, 51, 36, 784000)
datetime.datetime(2011, 9, 118, 14, 18, 23, 152000) datetime.datetime(2011, 9, 118, 14, 18, 23, 152000)
~~~~~ ~~~~~
That's it! You're ready to start saving data to Parse. 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 ParseObject, we should wrap it in a ParseBinaryDataWrapper. The ParseBinaryDataWrapper behaves just like a string, and inherits all of str's methods.
...@@ -80,16 +91,16 @@ We can also run more complex queries to retrieve a range of objects. For example ...@@ -80,16 +91,16 @@ We can also run more complex queries to retrieve a range of objects. For example
Notice how queries are built by chaining filter functions. The available filter functions are: Notice how queries are built by chaining filter functions. The available filter functions are:
* **Less Than** lt(_parameter_name_, _value_) * **Less Than**: lt(_parameter_name_, _value_)
* **Less Than Or Equal To** lte(_parameter_name_, _value_) * **Less Than Or Equal To**: lte(_parameter_name_, _value_)
* **Greater Than** gt(_parameter_name_, _value_) * **Greater Than**: gt(_parameter_name_, _value_)
* **Greater Than Or Equal To** gte(_parameter_name_, _value_) * **Greater Than Or Equal To**: gte(_parameter_name_, _value_)
* **Not Equal To** ne(_parameter_name_, _value_) * **Not Equal To**: ne(_parameter_name_, _value_)
* **Limit** limit(_count_) * **Limit**: limit(_count_)
* **Skip** skip(_count_) * **Skip**: skip(_count_)
We can also order the results using: We can also order the results using:
* **Order** order(_parameter_name_, _decending_=False) * **Order**: order(_parameter_name_, _decending_=False)
That's it! This is a first try at a Python library for Parse, and is probably not bug-free. If you run into any bugs, please get in touch -- parsepy@paulkastner.com. Thanks! That's it! This is a first try at a Python library for Parse, and is probably not bug-free. If you run into any bugs, please get in touch -- parsepy@paulkastner.com. Thanks!
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