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

Adding recursion on child of List Field #3104

Merged
merged 1 commit into from Jul 2, 2015
Merged

Conversation

Seraf
Copy link
Contributor

@Seraf Seraf commented Jul 2, 2015

This pull request add recursively the metadata of the child in a list field.

For a serializer like this :

class PowerSerializer(serializers.Serializer):
    groups = serializers.ListField(child=serializers.IntegerField(), default=[], required=False)

You will have this metadata:

"actions": {
    "POST": {
      "groups": {
        "type": "list",
        "required": false,
        "read_only": false,
        "label": "Groups",
        "child": {
          "type": "integer",
          "required": true,
          "read_only": false
        }
      }
    }
  }

I included the test directly in a existing test. Don't know if it was necessary to create a new one.
In the test provided, I use the recursion to be sure it works correctly.

@tomchristie tomchristie added this to the 3.1.4 Release milestone Jul 2, 2015
tomchristie added a commit that referenced this pull request Jul 2, 2015
Adding recursion on child of List Field
@tomchristie tomchristie merged commit c350755 into encode:master Jul 2, 2015
@tomchristie tomchristie modified the milestones: 3.1.4 Release, 3.2.0 Release Jul 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants