@@ -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:
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_)
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!