diff options
| author | tom christie tom@tomchristie.com | 2010-12-30 23:29:01 +0000 |
|---|---|---|
| committer | tom christie tom@tomchristie.com | 2010-12-30 23:29:01 +0000 |
| commit | c56e48f52e26a81d7a9f81fd74b0ea46d5434a90 (patch) | |
| tree | 98a2d33f9d23cbcbe77053a6ec6e1d3540442e99 /src/rest/parsers.py | |
| parent | a78f57847592fbaba9b483e2ace1591c9f295c71 (diff) | |
| download | django-rest-framework-c56e48f52e26a81d7a9f81fd74b0ea46d5434a90.tar.bz2 | |
Add parsers, form validation, etc...
Diffstat (limited to 'src/rest/parsers.py')
| -rw-r--r-- | src/rest/parsers.py | 8 |
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 |
