From 0febdc53b13641ac06ac406726da4ade5267b135 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Sat, 22 Jan 2011 17:38:53 +0000 Subject: [PATCH] simplify api --- pandora/app/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora/app/views.py b/pandora/app/views.py index 0c7aae0..2fc2651 100644 --- a/pandora/app/views.py +++ b/pandora/app/views.py @@ -48,7 +48,10 @@ def getPage(request): } ''' data = json.loads(request.POST['data']) - name = data['name'] + if isinstance(data, basestring): + name = data + else: + name = data['name'] page = get_object_or_404_json(models.Page, name=name) response = json_response({'name': page.name, 'body': page.body}) return render_to_json_response(response)