(self, sketch_id)
return jsonify(schema)
Handles GET request to the resource.

        Args:
          sketch_id (int): Identifier for the Sketch the datasource belongs to.

        Returns:
            A list of JSON representations of the data sources.
Handles GET request to the resource.
Handles GET request to the resource .
def get(self, sketch_id):
        """Handles GET request to the resource.

        Args:
          sketch_id (int): Identifier for the Sketch the datasource belongs to.

        Returns:
            A list of JSON representations of the data sources.
        """
        sketch = Sketch.query.get_with_acl(sketch_id)
        if not sketch:
            abort(
                HTTP_STATUS_CODE_NOT_FOUND,
                'No sketch found with this ID.')

        if sketch.get_status.status == 'archived':
            abort(
                HTTP_STATUS_CODE_BAD_REQUEST,
                'Unable to fetch data sources from an archived sketch.')

        number_of_timelines = 0
        data_sources = []
        for timeline in sketch.active_timelines:
            number_of_timelines += 1
            for data_source in timeline.datasources:
                data_sources.append(data_source)

        schema = {
            'meta': {
                'number_of_timelines': number_of_timelines,
                'number_of_sources': len(data_sources)
            },
            'objects': data_sources,
        }
        return jsonify(schema)
def get ( self , sketch_id ) : sketch = Sketch . query . get_with_acl ( sketch_id ) if not sketch : abort ( HTTP_STATUS_CODE_NOT_FOUND , 'No sketch found with this ID.' ) if sketch . get_status . status == 'archived' : abort ( HTTP_STATUS_CODE_BAD_REQUEST , 'Unable to fetch data sources from an archived sketch.' ) number_of_timelines = 0 data_sources = [ ] for timeline in sketch . active_timelines : number_of_timelines += 1 for data_source in timeline . datasources : data_sources . append ( data_source ) schema = { 'meta' : { 'number_of_timelines' : number_of_timelines , 'number_of_sources' : len ( data_sources ) } , 'objects' : data_sources , } return jsonify ( schema )