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
a9c347f1
Commit
a9c347f1
authored
Mar 25, 2015
by
Dan Krause
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #102 from dankrause/master
Base Role from Object instead of ParseResource
parents
6fc03b73
bb943e12
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
23 deletions
+5
-23
parse_rest/role.py
+5
-23
No files found.
parse_rest/role.py
View file @
a9c347f1
...
@@ -13,11 +13,11 @@
...
@@ -13,11 +13,11 @@
from
parse_rest.connection
import
API_ROOT
from
parse_rest.connection
import
API_ROOT
from
parse_rest.datatypes
import
ParseResource
from
parse_rest.datatypes
import
Object
from
parse_rest.query
import
QueryManager
from
parse_rest.query
import
QueryManager
class
Role
(
ParseResource
):
class
Role
(
Object
):
'''
'''
A Role is like a regular Parse object (can be modified and saved) but
A Role is like a regular Parse object (can be modified and saved) but
it requires additional methods and functionality
it requires additional methods and functionality
...
@@ -31,27 +31,9 @@ class Role(ParseResource):
...
@@ -31,27 +31,9 @@ class Role(ParseResource):
def
__repr__
(
self
):
def
__repr__
(
self
):
return
'<Role:
%
s (Id
%
s)>'
%
(
getattr
(
self
,
'name'
,
None
),
self
.
objectId
)
return
'<Role:
%
s (Id
%
s)>'
%
(
getattr
(
self
,
'name'
,
None
),
self
.
objectId
)
def
removeRelation
(
self
,
key
,
className
,
objectsId
):
@classmethod
self
.
manageRelation
(
'RemoveRelation'
,
key
,
className
,
objectsId
)
def
set_endpoint_root
(
cls
):
return
cls
.
ENDPOINT_ROOT
def
addRelation
(
self
,
key
,
className
,
objectsId
):
self
.
manageRelation
(
'AddRelation'
,
key
,
className
,
objectsId
)
def
manageRelation
(
self
,
action
,
key
,
className
,
objectsId
):
objects
=
[{
"__type"
:
"Pointer"
,
"className"
:
className
,
"objectId"
:
objectId
}
for
objectId
in
objectsId
]
payload
=
{
key
:
{
"__op"
:
action
,
"objects"
:
objects
}
}
self
.
__class__
.
PUT
(
self
.
_absolute_url
,
**
payload
)
self
.
__dict__
[
key
]
=
''
Role
.
Query
=
QueryManager
(
Role
)
Role
.
Query
=
QueryManager
(
Role
)
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