Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
ParsePy
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ParsePy
Commits
5884cffd
Commit
5884cffd
authored
Mar 11, 2013
by
Raphael Lullis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More updates to README.
parent
455c25a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
8 deletions
+16
-8
README.mkd
+16
-8
No files found.
README.mkd
View file @
5884cffd
...
@@ -186,7 +186,9 @@ the appropiates classes to work with them. One such example is
...
@@ -186,7 +186,9 @@ the appropiates classes to work with them. One such example is
`GeoPoint`
, where you store latitude and longitude
`GeoPoint`
, where you store latitude and longitude
~~~
~~ {python}
~~~
~~ {python}
class Restaurant(parse_rest.Object):
from parse_rest.datatypes import Object
class Restaurant(Object):
pass
pass
restaurant = Restaurant(name="Los Pollos Hermanos")
restaurant = Restaurant(name="Los Pollos Hermanos")
...
@@ -198,7 +200,9 @@ restaurant.save()
...
@@ -198,7 +200,9 @@ restaurant.save()
We can store a reference to another Object by assigning it to an attribute:
We can store a reference to another Object by assigning it to an attribute:
~~~
~~ {python}
~~~
~~ {python}
class CollectedItem(parse_rest.Object):
from parse_rest.datatypes import Object
class CollectedItem(Object):
pass
pass
collectedItem = CollectedItem(type="Sword", isAwesome=True)
collectedItem = CollectedItem(type="Sword", isAwesome=True)
...
@@ -326,16 +330,18 @@ for post in posts_by_joe:
...
@@ -326,16 +330,18 @@ for post in posts_by_joe:
Users
Users
-----
-----
You can sign up, log in, modify or delete users as well, using the
`
User`
object
. You sign a user up as follows:
You can sign up, log in, modify or delete users as well, using the
`
parse_rest.user.User`
class
. You sign a user up as follows:
~~~
~~ {python}
~~~
~~ {python}
u = parse_rest.User.signup("dhelmet", "12345", phone="555-555-5555")
from parse_rest.user import User
u = User.signup("dhelmet", "12345", phone="555-555-5555")
~~~
~~
~~~
~~
or log in an existing user with
or log in an existing user with
~~~
~~ {python}
~~~
~~ {python}
u =
parse_rest.
User.login("dhelmet", "12345")
u = User.login("dhelmet", "12345")
~~~
~~
~~~
~~
Once a
`User`
has been logged in, it saves its session so that it can be edited or deleted:
Once a
`User`
has been logged in, it saves its session so that it can be edited or deleted:
...
@@ -378,13 +384,15 @@ Parse.Cloud.define("averageStars", function(request, response) {
...
@@ -378,13 +384,15 @@ Parse.Cloud.define("averageStars", function(request, response) {
});
});
~~~
~~
~~~
~~
Then you can call either of these functions using the
`parse_rest.Function`
class:
Then you can call either of these functions using the
`parse_rest.
datatypes.
Function`
class:
~~~
~~ {python}
~~~
~~ {python}
hello_func = parse_rest.Function("hello")
from parse_rest.datatypes import Function
hello_func = Function("hello")
hello_func()
hello_func()
{u'result': u'Hello world!'}
{u'result': u'Hello world!'}
star_func =
parse_rest.
Function("averageStars")
star_func = Function("averageStars")
star_func(movie="The Matrix")
star_func(movie="The Matrix")
{u'result': 4.5}
{u'result': 4.5}
~~~
~~
~~~
~~
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment