Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove MergeDict #2640

Merged
merged 1 commit into from
Mar 6, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions rest_framework/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from django.http.multipartparser import parse_header
from django.utils import six
from django.utils.datastructures import MultiValueDict
from django.utils.datastructures import MergeDict as DjangoMergeDict
from rest_framework import HTTP_HEADER_ENCODING
from rest_framework import exceptions
from rest_framework.settings import api_settings
Expand Down Expand Up @@ -61,15 +60,6 @@ def __exit__(self, *args, **kwarg):
self.view.action = self.action


class MergeDict(DjangoMergeDict, dict):
"""
Using this as a workaround until the parsers API is properly
addressed in 3.1.
"""
def __init__(self, *dicts):
self.dicts = dicts


class Empty(object):
"""
Placeholder for unset attributes.
Expand Down Expand Up @@ -328,7 +318,8 @@ def _load_data_and_files(self):
if not _hasattr(self, '_data'):
self._data, self._files = self._parse()
if self._files:
self._full_data = MergeDict(self._data, self._files)
self._full_data = self._data.copy()
self._full_data.update(self._files)
else:
self._full_data = self._data

Expand Down Expand Up @@ -392,7 +383,8 @@ def _perform_form_overloading(self):
# At this point we're committed to parsing the request as form data.
self._data = self._request.POST
self._files = self._request.FILES
self._full_data = MergeDict(self._data, self._files)
self._full_data = self._data.copy()
self._full_data.update(self._files)

# Method overloading - change the method and remove the param from the content.
if (
Expand Down