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

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

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

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

        Returns:
            A story in JSON (instance of flask.wrappers.Response)
        """
        form = forms.ExploreForm.build(request)
        if not form.validate_on_submit():
            abort(
                HTTP_STATUS_CODE_BAD_REQUEST, 'Unable to validate form data.')
        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.')
        schema = {
            'objects': [],
            'meta': {}}
        query_string = form.query.data
        query_filter = form.filter.data
        query_dsl = form.dsl.data
        query = self.datastore.build_query(
            sketch.id, query_string, query_filter, query_dsl)
        schema['objects'].append(query)
        return jsonify(schema)
def post ( self , sketch_id ) : form = forms . ExploreForm . build ( request ) if not form . validate_on_submit ( ) : abort ( HTTP_STATUS_CODE_BAD_REQUEST , 'Unable to validate form data.' ) 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.' ) schema = { 'objects' : [ ] , 'meta' : { } } query_string = form . query . data query_filter = form . filter . data query_dsl = form . dsl . data query = self . datastore . build_query ( sketch . id , query_string , query_filter , query_dsl ) schema [ 'objects' ] . append ( query ) return jsonify ( schema )