simplify api
This commit is contained in:
parent
ce1c326b80
commit
0febdc53b1
1 changed files with 4 additions and 1 deletions
|
@ -48,6 +48,9 @@ def getPage(request):
|
||||||
}
|
}
|
||||||
'''
|
'''
|
||||||
data = json.loads(request.POST['data'])
|
data = json.loads(request.POST['data'])
|
||||||
|
if isinstance(data, basestring):
|
||||||
|
name = data
|
||||||
|
else:
|
||||||
name = data['name']
|
name = data['name']
|
||||||
page = get_object_or_404_json(models.Page, name=name)
|
page = get_object_or_404_json(models.Page, name=name)
|
||||||
response = json_response({'name': page.name, 'body': page.body})
|
response = json_response({'name': page.name, 'body': page.body})
|
||||||
|
|
Loading…
Reference in a new issue