diff options
| author | Tom Christie | 2014-09-26 13:08:20 +0100 | 
|---|---|---|
| committer | Tom Christie | 2014-09-26 13:08:20 +0100 | 
| commit | 2e87de01430d7fec83f00948e60c8d61b317053b (patch) | |
| tree | 7b5bab0b28d042dfcf834f47cad22534b6d9d47f /rest_framework/serializers.py | |
| parent | 8b8623c5f84d443d26804cac52a793a3037a1dd0 (diff) | |
| download | django-rest-framework-2e87de01430d7fec83f00948e60c8d61b317053b.tar.bz2 | |
Added ListField
Diffstat (limited to 'rest_framework/serializers.py')
| -rw-r--r-- | rest_framework/serializers.py | 6 | 
1 files changed, 4 insertions, 2 deletions
diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py index 245ec26f..fa2e8fb1 100644 --- a/rest_framework/serializers.py +++ b/rest_framework/serializers.py @@ -287,6 +287,9 @@ class Serializer(BaseSerializer):          return representation.serializer_repr(self, indent=1) +# There's some replication of `ListField` here, +# but that's probably better than obfuscating the call hierarchy. +  class ListSerializer(BaseSerializer):      child = None      initial = [] @@ -301,7 +304,7 @@ class ListSerializer(BaseSerializer):      def get_value(self, dictionary):          # We override the default field access in order to support          # lists in HTML forms. -        if is_html_input(dictionary): +        if html.is_html_input(dictionary):              return html.parse_html_list(dictionary, prefix=self.field_name)          return dictionary.get(self.field_name, empty) @@ -311,7 +314,6 @@ class ListSerializer(BaseSerializer):          """          if html.is_html_input(data):              data = html.parse_html_list(data) -          return [self.child.run_validation(item) for item in data]      def to_representation(self, data):  | 
