def save_author(self, author_url, author_name, author_twitter, author_bio): author = Author.query.filter(Author.url == author_url).first() if (isinstance(author, Author) == False): author = Author() author.url = author_url author.name = author_name author.twitter = author_twitter author.bio = author_bio db.session.add(author) db.session.commit() db.session.refresh(author) return author