(self, title)
return Story(story)
Add a story to the Sketch.

        Args:
            title: The name of the view.

        Raises:
            ValueError: If both query_string an query_dsl are missing.

        Returns:
            An instance of a Story object.
Add a story to the Sketch.
Add a story to the Sketch .
def add_story(self, title):
        """Add a story to the Sketch.

        Args:
            title: The name of the view.

        Raises:
            ValueError: If both query_string an query_dsl are missing.

        Returns:
            An instance of a Story object.
        """
        story = SQLStory.query.filter_by(
            title=title, sketch=self.sql_sketch, user=None).first()

        if story:
            return Story(story)

        story = SQLStory.get_or_create(
            title=title, content='[]', sketch=self.sql_sketch, user=None)
        db_session.add(story)
        db_session.commit()
        return Story(story)
def add_story ( self , title ) : story = SQLStory . query . filter_by ( title = title , sketch = self . sql_sketch , user = None ) . first ( ) if story : return Story ( story ) story = SQLStory . get_or_create ( title = title , content = '[]' , sketch = self . sql_sketch , user = None ) db_session . add ( story ) db_session . commit ( ) return Story ( story )