"""
Session = sessionmaker(bind=self.engine)
session = Session()
- m = Tweet(tweet_id)
- session.add(m)
+ t = Tweet(tweet_id)
+ session.add(t)
session.commit()
def rainbow_to_tweet_query(self, rid):
session = Session()
res = session.query(Message).filter_by(message_id=mid).all()
return res
+
+ def theme_store(self, theme_name):
+ """
+ Store theme
+ """
+ Session = sessionmaker(bind=self.engine)
+ session = Session()
+ th = Theme(theme_name)
+ session.add(th)
+ session.commit()
+
+ def theme_update(self, theme_name):
+ """
+ Update theme
+ """
+ Session = sessionmaker(bind=self.engine)
+ session = Session()
+ res = session.query(Theme).all()
+ for r in res:
+ r.theme_name = theme_name
+ session.commit()
+
+ def theme_query(self):
+ """
+ Query theme
+ """
+ Session = sessionmaker(bind=self.engine)
+ session = Session()
+ res = session.query(Theme).all()
+ return res