add list support and seperate help
[rainbowstream.git] / rainbowstream / db.py
index 5bfb04081c715ad1b8f2690b1527a42987e9222a..2ab23bce0e80a371f05792886c32644a6e82e991 100644 (file)
@@ -98,3 +98,23 @@ class RainbowDB():
         session = Session()
         res = session.query(Theme).all()
         return res
+
+    def list_store(self, list_id, list_name):
+        """
+        Store list id and name
+        """
+        Session = sessionmaker(bind=self.engine)
+        session = Session()
+        l = List(list_id, list_name)
+        session.add(l)
+        session.commit()
+
+    def list_name_to_id_query(self, list_name):
+        """
+        Query base of list id
+        """
+        Session = sessionmaker(bind=self.engine)
+        session = Session()
+        res = session.query(List).filter_by(list_name=list_name).all()
+        return res
+