def make_author(self, data, **kwargs): author = Author.query.filter_by(name=data['name']).first() if not author: author = Author() author.name = data['name'] return author