Skip to content

Commit

Permalink
Support multivalues in FormParser
Browse files Browse the repository at this point in the history
  • Loading branch information
klen committed Aug 31, 2012
1 parent f912bf1 commit 07efe72
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Expand Up @@ -12,4 +12,6 @@ branches:
install: install:
- pip install -IM pylama - pip install -IM pylama


script: make test script:
- make audit
- make test
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -19,7 +19,7 @@ upload: doc
python setup.py sdist upload || echo 'Upload already' python setup.py sdist upload || echo 'Upload already'


.PHONY: test .PHONY: test
test: audit test:
python setup.py test python setup.py test


.PHONY: audit .PHONY: audit
Expand Down
2 changes: 1 addition & 1 deletion adrest/utils/parser.py
Expand Up @@ -24,7 +24,7 @@ class FormParser(BaseParser):


@staticmethod @staticmethod
def parse(request): def parse(request):
return dict(request.POST.iteritems()) return dict((k, v if len(v) > 1 else v[0]) for k, v in request.POST.iterlists())




class JSONParser(BaseParser): class JSONParser(BaseParser):
Expand Down

0 comments on commit 07efe72

Please sign in to comment.