예제 #1
0
 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()
예제 #2
0
 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
예제 #3
0
 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