def get_comment_by_preview_file_id(preview_file_id): """ Return comment related to given preview file as a dict. """ comment = Comment.get_by(preview_file_id=preview_file_id) if comment is not None: return comment.serialize() else: return None
def import_entry(self, data): comment = Comment.get_by(shotgun_id=data["shotgun_id"]) if comment is None: comment = Comment(**data) comment.save() current_app.logger.info("Comment created: %s" % comment) else: comment.update(data) current_app.logger.info("Comment updated: %s" % comment) return comment