From b9316154b163ee6ecf2005f986f40f7fe7ef5bcc Mon Sep 17 00:00:00 2001 From: Dawn Pattison Date: Fri, 16 Oct 2015 16:02:13 -0400 Subject: [PATCH] Add tuple and Set to allowed ListField data types --- rest_framework/fields.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 94c70afd0..f98917a6a 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -1,4 +1,5 @@ from __future__ import unicode_literals +from sets import Set import collections import copy @@ -1461,7 +1462,7 @@ class ListField(Field): """ if html.is_html_input(data): data = html.parse_html_list(data) - if not isinstance(data, list): + if not isinstance(data, (list, tuple, Set)): self.fail('not_a_list', input_type=type(data).__name__) if not self.allow_empty and len(data) == 0: self.fail('empty')