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

        Returns:
            A sketch 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.

        Returns:
            A sketch in JSON (instance of flask.wrappers.Response)
        """
        if current_user.admin:
            sketch = Sketch.query.get(sketch_id)
        else:
            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'):
            if not current_user.admin:
                abort(
                    HTTP_STATUS_CODE_FORBIDDEN, (
                        'User does not have sufficient access rights to '
                        'read the sketch.'))

        timelines = {
            t.searchindex.index_name: t.get_status.status == 'archived'
            for t in sketch.timelines}

        meta = {
            'is_archived': sketch.get_status.status == 'archived',
            'sketch_id': sketch.id,
            'sketch_name': sketch.name,
            'timelines': timelines,
        }
        schema = {
            'meta': meta,
            'objects': []
        }
        return jsonify(schema)
def get ( self , sketch_id ) : if current_user . admin : sketch = Sketch . query . get ( sketch_id ) else : 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' ) : if not current_user . admin : abort ( HTTP_STATUS_CODE_FORBIDDEN , ( 'User does not have sufficient access rights to ' 'read the sketch.' ) ) timelines = { t . searchindex . index_name : t . get_status . status == 'archived' for t in sketch . timelines } meta = { 'is_archived' : sketch . get_status . status == 'archived' , 'sketch_id' : sketch . id , 'sketch_name' : sketch . name , 'timelines' : timelines , } schema = { 'meta' : meta , 'objects' : [ ] } return jsonify ( schema )