def update_review(self, id, tier, anonym: bool, text): review = Review(id=id, tier=tier, anonym=anonym, text_review=text, date=datetime.date.today()) session.merge(review) session.commit()
def add_review(self, author, subject, tier, anonym: bool, text): try: review = Review(member_ID=str(author), subject=subject, tier=tier, anonym=anonym, text_review=text, date=datetime.date.today()) session.add(review) session.commit() except Exception: session.rollback() raise
def add_review(self, author, subject, tier, anonym: bool, text) -> Review: try: review = Review( discord_id=str(author), subject=subject, tier=tier, anonym=anonym, text_review=text, date=datetime.date.today(), ) session.add(review) session.commit() except Exception: session.rollback() raise return review