Python flask_restful.fields.Nested() Examples

The following are 2 code examples of flask_restful.fields.Nested(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module flask_restful.fields , or try the search function .
Example #1
Source File: resource_models.py    From cloudify-manager with Apache License 2.0 5 votes vote down vote up
def response_fields(cls):
        fields = super(Deployment, cls).response_fields
        fields['workflows'] = flask_fields.List(
            flask_fields.Nested(Workflow.resource_fields)
        )
        return fields 
Example #2
Source File: resource_models.py    From cloudify-manager with Apache License 2.0 5 votes vote down vote up
def response_fields(cls):
        fields = super(DeploymentUpdate, cls).response_fields
        fields['steps'] = flask_fields.List(
            flask_fields.Nested(DeploymentUpdateStep.response_fields)
        )
        dependency_fields = {
            'deployment': flask_fields.String,
            'dependency_type': flask_fields.String,
            'dependent_node': flask_fields.String,
            'tenant': flask_fields.String
        }
        fields['recursive_dependencies'] = flask_fields.List(
            flask_fields.Nested(dependency_fields))
        return fields