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
c07dc0d3
Commit
c07dc0d3
authored
Jan 14, 2017
by
Miles Richardson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add file uploading example to readme
parent
26f6808f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
1 deletions
+35
-1
README.mkd
+35
-1
No files found.
README.mkd
View file @
c07dc0d3
...
@@ -20,7 +20,7 @@ parse_rest
...
@@ -20,7 +20,7 @@ parse_rest
-
Installation querying
-
Installation querying
-
push
-
push
-
Roles/ACLs
**
-
Roles/ACLs
**
-
**PLANNED/TODO**
: Image/File type support
-
Image/File type support (done 1/14/17)
**
for applications with access to the MASTER KEY, see details below.
**
for applications with access to the MASTER KEY, see details below.
...
@@ -269,6 +269,40 @@ collectedItem.save() # we have to save it before it can be referenced
...
@@ -269,6 +269,40 @@ collectedItem.save() # we have to save it before it can be referenced
gameScore.item = collectedItem
gameScore.item = collectedItem
~~~
~~
~~~
~~
File Support
---------------
You can upload files to parse (assuming your
`parse-server`
instance supports it).
This has been tested with the default GridStore adapter.
Example:
~~~
~~ {python}
from parse_rest.datatypes import Object, File
class GameScore(Object):
pass
# 1. Upload file
with open('/path/to/screenshot.png', 'rb') as fh:
rawdata = fh.read()
screenshotFile = File('arbitraryNameOfFile', rawdata, 'image/png')
screenshotFile.save()
print screenshotFile.url
# 2. Attach file to gamescore object and save
gs = GameScore.Query.get(objectId='xxxxxxx')
gs.screenshot = screenshotFile
gs.save()
print gs.file.url
~~~
~~
Batch Operations
Batch Operations
----------------
----------------
...
...
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