(self, sketch_id, timeline_id)
return self.to_json(timeline)
Handles GET request to the resource.

        Args:
            sketch_id: Integer primary key for a sketch database model
            timeline_id: Integer primary key for a timeline database model
Handles GET request to the resource.
Handles GET request to the resource .
def get(self, sketch_id, timeline_id):
        """Handles GET request to the resource.

        Args:
            sketch_id: Integer primary key for a sketch database model
            timeline_id: Integer primary key for a timeline database model
        """
        sketch = Sketch.query.get_with_acl(sketch_id)
        if not sketch:
            abort(
                HTTP_STATUS_CODE_NOT_FOUND, 'No sketch found with this ID.')

        timeline = Timeline.query.get(timeline_id)
        if not timeline:
            abort(
                HTTP_STATUS_CODE_NOT_FOUND, 'No Timeline found with this ID.')

        if timeline.sketch is None:
            abort(
                HTTP_STATUS_CODE_NOT_FOUND,
                f'The timeline {timeline_id} does not have an associated '
                'sketch, does it belong to a sketch?')

        # Check that this timeline belongs to the sketch
        if timeline.sketch.id != sketch.id:
            abort(
                HTTP_STATUS_CODE_NOT_FOUND,
                'The sketch ID ({0:d}) does not match with the timeline '
                'sketch ID ({1:d})'.format(sketch.id, timeline.sketch.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.')

        return self.to_json(timeline)
def get ( self , sketch_id , timeline_id ) : sketch = Sketch . query . get_with_acl ( sketch_id ) if not sketch : abort ( HTTP_STATUS_CODE_NOT_FOUND , 'No sketch found with this ID.' ) timeline = Timeline . query . get ( timeline_id ) if not timeline : abort ( HTTP_STATUS_CODE_NOT_FOUND , 'No Timeline found with this ID.' ) if timeline . sketch is None : abort ( HTTP_STATUS_CODE_NOT_FOUND , f'The timeline {timeline_id} does not have an associated ' 'sketch, does it belong to a sketch?' ) # Check that this timeline belongs to the sketch if timeline . sketch . id != sketch . id : abort ( HTTP_STATUS_CODE_NOT_FOUND , 'The sketch ID ({0:d}) does not match with the timeline ' 'sketch ID ({1:d})' . format ( sketch . id , timeline . sketch . 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.' ) return self . to_json ( timeline )