{"action":"created","issue":{"url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3563","repository_url":"https://api.github.com/repos/tomchristie/django-rest-framework","labels_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3563/labels{/name}","comments_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3563/comments","events_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3563/events","html_url":"https://github.com/tomchristie/django-rest-framework/issues/3563","id":113974069,"number":3563,"title":"ListSerializer and ListField returning a proxy object in validation response","user":{"login":"awbacker","id":103330,"avatar_url":"https://avatars.githubusercontent.com/u/103330?v=3","gravatar_id":"","url":"https://api.github.com/users/awbacker","html_url":"https://github.com/awbacker","followers_url":"https://api.github.com/users/awbacker/followers","following_url":"https://api.github.com/users/awbacker/following{/other_user}","gists_url":"https://api.github.com/users/awbacker/gists{/gist_id}","starred_url":"https://api.github.com/users/awbacker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awbacker/subscriptions","organizations_url":"https://api.github.com/users/awbacker/orgs","repos_url":"https://api.github.com/users/awbacker/repos","events_url":"https://api.github.com/users/awbacker/events{/privacy}","received_events_url":"https://api.github.com/users/awbacker/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/tomchristie/django-rest-framework/labels/Needs%20confirmation","name":"Needs confirmation","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-29T03:46:03Z","updated_at":"2016-03-04T20:53:48Z","closed_at":null,"body":"I upgraded to 3.3 and starting using the new ListField (and trying ListSerializer).  I have a series of \"bad values\" I test on, and in 3 of those 5 cases I get a `proxy` object back instead of a validation error message.\r\n\r\nThe test case looks like this:\r\n```\r\n# in the serializer\r\ncorner_points = serializers.ListField(child=serializers.IntegerField(), required=True)\r\n\r\n# test case's invalid values, for one reason or another\r\ntest_cornerpoints = [   [1, 2, 3, 4, 5, 6, 7], [], ['abc'], 'efg', 1 ]\r\nfor cp in test_cornerpoints:\r\n    self.api = APIClient()\r\n   # also has an image, so this posts as multipart form-data\r\n    resp = self.api.post(url, data={ 'corner_points': cp })  \r\n    print(resp.data)\r\n```\r\n\r\n** I should mention that I have a custom validate_corner_points function ** I'm checking into that now, it just requires that the list length be divisible by 2.\r\n\r\nAnd the output from the print statement above (the status code is 400)\r\n```\r\n{'corner_points': [<django.utils.functional.__proxy__ object at 0x1154b9090>]}\r\n{'corner_points': [<django.utils.functional.__proxy__ object at 0x115232d10>]}\r\n{'corner_points': [u'A valid integer is required.']}\r\n{'corner_points': [u'A valid integer is required.']}\r\n{'corner_points': [<django.utils.functional.__proxy__ object at 0x1153011d0>]}\r\n```\r\n\r\nPrior to this I was using a custom list serializer that handed the `field_name[]` format that arrays come in in FormData.  So far I think the new version is working with this, but the docs should make note that `request.POST` is gone now, and you can only use `requests.data`.  At least in my case, there were no values in `request.POST` for multipart/form-data."},"comment":{"url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/comments/192463808","html_url":"https://github.com/tomchristie/django-rest-framework/issues/3563#issuecomment-192463808","issue_url":"https://api.github.com/repos/tomchristie/django-rest-framework/issues/3563","id":192463808,"user":{"login":"kylefox","id":37838,"avatar_url":"https://avatars.githubusercontent.com/u/37838?v=3","gravatar_id":"","url":"https://api.github.com/users/kylefox","html_url":"https://github.com/kylefox","followers_url":"https://api.github.com/users/kylefox/followers","following_url":"https://api.github.com/users/kylefox/following{/other_user}","gists_url":"https://api.github.com/users/kylefox/gists{/gist_id}","starred_url":"https://api.github.com/users/kylefox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylefox/subscriptions","organizations_url":"https://api.github.com/users/kylefox/orgs","repos_url":"https://api.github.com/users/kylefox/repos","events_url":"https://api.github.com/users/kylefox/events{/privacy}","received_events_url":"https://api.github.com/users/kylefox/received_events","type":"User","site_admin":false},"created_at":"2016-03-04T20:53:48Z","updated_at":"2016-03-04T20:53:48Z","body":"I ran into this issue while setting up token authentication, and haven't found a solution\r\n\r\nFrom what I can tell the problem is not related to the auth system, but perhaps the serialization of lists:\r\n\r\n```python\r\nresponse = self.client.post('/api-token-auth/', {\r\n            'username': 'test_user',\r\n            'password': 'incorrect'})\r\n\r\nprint response.data\r\n# {u'non_field_errors': [<django.utils.functional.__proxy__ object at 0x10302e390>]}\r\n\r\nprint response.data['non_field_errors']\r\n# [<django.utils.functional.__proxy__ object at 0x10871e390>]\r\n\r\nprint response.data['non_field_errors'][0]\r\n# u\"Unable to log in with provided credentials.\"\r\n```"}}