Mac not support screen
[rainbowstream.git] / rainbowstream / db.py
index 57428c42bc81f8eb7062e3c31ec623b8c4d5fd57..cac9a73d6a62dd0f05ab45cea3afa1520891561e 100644 (file)
@@ -30,8 +30,7 @@ class RainbowDB():
         """
         Session = sessionmaker(bind=self.engine)
         session = Session()
-        res = session.query(Map)
-            .filter("rainbow_id =:rid").params(rid=rid).all()
+        res = session.query(Map).filter_by(rainbow_id=rid).all()
         return res
 
     def tweet_query(self, tid):
@@ -40,15 +39,5 @@ class RainbowDB():
         """
         Session = sessionmaker(bind=self.engine)
         session = Session()
-        res = session.query(Map)
-            .filter("tweet_id =:tid").params(tid=tid).all()
-        return res
-
-    def truncate(self):
-        """
-        Truncate table
-        """
-        Session = sessionmaker(bind=self.engine)
-        session = Session()
-        session.query(Map).delete()
-        session.commit()
+        res = session.query(Map).filter_by(tweet_id=tid).all()
+        return res
\ No newline at end of file