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

        Handler for /api/v1/sketches/<int:sketch_id>/aggregation/group/

        Args:
            sketch_id: Integer primary key for a sketch database model

        Returns:
            Views in JSON (instance of flask.wrappers.Response)
Handles GET request to the resource.
Handles GET request to the resource .
def get(self, sketch_id):
        """Handles GET request to the resource.

        Handler for /api/v1/sketches/<int:sketch_id>/aggregation/group/

        Args:
            sketch_id: Integer primary key for a sketch database model

        Returns:
            Views in JSON (instance of flask.wrappers.Response)
        """
        sketch = Sketch.query.get_with_acl(sketch_id)
        if not sketch:
            abort(
                HTTP_STATUS_CODE_NOT_FOUND, 'No sketch found with this ID.')

        if not sketch.has_permission(user=current_user, permission='read'):
            abort(
                HTTP_STATUS_CODE_FORBIDDEN,
                'The user does not have read permission on the sketch.')
        groups = AggregationGroup.query.filter_by(
            sketch_id=sketch_id).all()
        meta = {
            'command': 'list_groups',
        }
        objects = []
        for group in groups:
            group_dict = {
                'id': group.id,
                'name': group.name,
                'parameters': group.parameters,
                'orientation': group.orientation,
                'description': group.description,
                'agg_ids': json.dumps([x.id for x in group.aggregations])
            }
            objects.append(group_dict)
        response = jsonify({'meta': meta, 'objects': objects})
        response.status_code = HTTP_STATUS_CODE_OK

        # Update the last activity of a sketch.
        utils.update_sketch_last_activity(sketch)

        return response
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 not sketch . has_permission ( user = current_user , permission = 'read' ) : abort ( HTTP_STATUS_CODE_FORBIDDEN , 'The user does not have read permission on the sketch.' ) groups = AggregationGroup . query . filter_by ( sketch_id = sketch_id ) . all ( ) meta = { 'command' : 'list_groups' , } objects = [ ] for group in groups : group_dict = { 'id' : group . id , 'name' : group . name , 'parameters' : group . parameters , 'orientation' : group . orientation , 'description' : group . description , 'agg_ids' : json . dumps ( [ x . id for x in group . aggregations ] ) } objects . append ( group_dict ) response = jsonify ( { 'meta' : meta , 'objects' : objects } ) response . status_code = HTTP_STATUS_CODE_OK # Update the last activity of a sketch. utils . update_sketch_last_activity ( sketch ) return response