forked from 0x2620/pandora
eror
This commit is contained in:
parent
d3fb5413ab
commit
3fa267a067
1 changed files with 12 additions and 6 deletions
|
@ -33,7 +33,7 @@ def api(request):
|
||||||
if request.META['REQUEST_METHOD'] == "OPTIONS":
|
if request.META['REQUEST_METHOD'] == "OPTIONS":
|
||||||
response = HttpResponse('')
|
response = HttpResponse('')
|
||||||
#response = render_to_json_response({'status': {'code': 200, 'text': 'please use POST'}})
|
#response = render_to_json_response({'status': {'code': 200, 'text': 'please use POST'}})
|
||||||
#response['Access-Control-Allow-Origin'] = '*'
|
response['Access-Control-Allow-Origin'] = '*'
|
||||||
return response
|
return response
|
||||||
if not 'action' in request.POST:
|
if not 'action' in request.POST:
|
||||||
return apidoc(request)
|
return apidoc(request)
|
||||||
|
@ -67,7 +67,7 @@ def api_error(request):
|
||||||
'''
|
'''
|
||||||
trows 503 error
|
trows 503 error
|
||||||
'''
|
'''
|
||||||
this = is_an_error
|
success = error_is_success
|
||||||
return render_to_json_response({})
|
return render_to_json_response({})
|
||||||
|
|
||||||
def _order_query(qs, s, prefix='sort__'):
|
def _order_query(qs, s, prefix='sort__'):
|
||||||
|
@ -454,6 +454,10 @@ def api_update(request):
|
||||||
response = {'status': {'code': 403, 'text': 'permission denied'}}
|
response = {'status': {'code': 403, 'text': 'permission denied'}}
|
||||||
return render_to_json_response(response)
|
return render_to_json_response(response)
|
||||||
|
|
||||||
|
class UploadForm(forms.Form):
|
||||||
|
data = forms.TextInput()
|
||||||
|
file = forms.FileField()
|
||||||
|
|
||||||
def api_upload(request): #video, timeline, frame
|
def api_upload(request): #video, timeline, frame
|
||||||
'''
|
'''
|
||||||
upload video, timeline or frame
|
upload video, timeline or frame
|
||||||
|
@ -462,6 +466,8 @@ def api_upload(request): #video, timeline, frame
|
||||||
return {'status': {'code': int, 'text': string},
|
return {'status': {'code': int, 'text': string},
|
||||||
'data': {}}
|
'data': {}}
|
||||||
'''
|
'''
|
||||||
|
form = LoginForm(request.POST, request.FILES)
|
||||||
|
if form.is_valid():
|
||||||
data = json.loads(request.POST['data'])
|
data = json.loads(request.POST['data'])
|
||||||
if data['item'] == 'timeline':
|
if data['item'] == 'timeline':
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in a new issue