(self, sketch_id, aggregation_id)
return self.to_json(aggregation)
Handles GET request to the resource.

        Handler for /api/v1/sketches/:sketch_id/aggregation/:aggregation_id

        Args:
            sketch_id: Integer primary key for a sketch database model.
            aggregation_id: Integer primary key for an aggregation database
                model.

        Returns:
            JSON with aggregation results
Handles GET request to the resource.
Handles GET request to the resource .
def get(self, sketch_id, aggregation_id):  # pylint: disable=unused-argument
        """Handles GET request to the resource.

        Handler for /api/v1/sketches/:sketch_id/aggregation/:aggregation_id

        Args:
            sketch_id: Integer primary key for a sketch database model.
            aggregation_id: Integer primary key for an aggregation database
                model.

        Returns:
            JSON with aggregation results
        """
        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(current_user, 'read'):
            abort(HTTP_STATUS_CODE_FORBIDDEN,
                  'User does not have read access controls on sketch.')
        aggregation = Aggregation.query.get(aggregation_id)

        # Check that this aggregation belongs to the sketch
        if aggregation.sketch_id != sketch.id:
            abort(
                HTTP_STATUS_CODE_NOT_FOUND,
                'The sketch ID ({0:d}) does not match with the defined '
                'sketch in the aggregation ({1:d})'.format(
                    aggregation.sketch_id, sketch.id))

        # If this is a user state view, check that it
        # belongs to the current_user
        if aggregation.name == '' and aggregation.user != current_user:
            abort(
                HTTP_STATUS_CODE_FORBIDDEN, (
                    'A user state view can only be viewed by the user it '
                    'belongs to.'))

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

        return self.to_json(aggregation)
def get ( self , sketch_id , aggregation_id ) : # pylint: disable=unused-argument 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 ( current_user , 'read' ) : abort ( HTTP_STATUS_CODE_FORBIDDEN , 'User does not have read access controls on sketch.' ) aggregation = Aggregation . query . get ( aggregation_id ) # Check that this aggregation belongs to the sketch if aggregation . sketch_id != sketch . id : abort ( HTTP_STATUS_CODE_NOT_FOUND , 'The sketch ID ({0:d}) does not match with the defined ' 'sketch in the aggregation ({1:d})' . format ( aggregation . sketch_id , sketch . id ) ) # If this is a user state view, check that it # belongs to the current_user if aggregation . name == '' and aggregation . user != current_user : abort ( HTTP_STATUS_CODE_FORBIDDEN , ( 'A user state view can only be viewed by the user it ' 'belongs to.' ) ) # Update the last activity of a sketch. utils . update_sketch_last_activity ( sketch ) return self . to_json ( aggregation )