aboutsummaryrefslogtreecommitdiffstats
path: root/src/rest/parsers.py
diff options
context:
space:
mode:
authortom christie tom@tomchristie.com2010-12-30 23:29:01 +0000
committertom christie tom@tomchristie.com2010-12-30 23:29:01 +0000
commitc56e48f52e26a81d7a9f81fd74b0ea46d5434a90 (patch)
tree98a2d33f9d23cbcbe77053a6ec6e1d3540442e99 /src/rest/parsers.py
parenta78f57847592fbaba9b483e2ace1591c9f295c71 (diff)
downloaddjango-rest-framework-c56e48f52e26a81d7a9f81fd74b0ea46d5434a90.tar.bz2
Add parsers, form validation, etc...
Diffstat (limited to 'src/rest/parsers.py')
-rw-r--r--src/rest/parsers.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rest/parsers.py b/src/rest/parsers.py
index 038065f0..0f914471 100644
--- a/src/rest/parsers.py
+++ b/src/rest/parsers.py
@@ -1,3 +1,5 @@
+import json
+
class BaseParser(object):
def __init__(self, resource, request):
self.resource = resource
@@ -8,11 +10,13 @@ class BaseParser(object):
class JSONParser(BaseParser):
- pass
+ def parse(self, input):
+ return json.loads(input)
class XMLParser(BaseParser):
pass
class FormParser(BaseParser):
- pass
+ def parse(self, input):
+ return self.request.POST