Beispiel #1
0
 def deleteentrys(self, entrys):
     connection = db.engine.connect()
     trans = connection.begin()
     try:
         for entry in entrys:
             connection.execute(ShoeTable.delete().where(ShoeTable.c.Id == entry.Id))
         trans.commit()
     except Exception, e:
         trans.rollback()
Beispiel #2
0
 def addentrys(self, entrys):
     connection = db.engine.connect()
     trans = connection.begin()
     try:
         for entry in entrys:
             ins = ShoeTable.insert().values(Id=entry.Id, Title=entry.Title, Url=entry.Url, Number=entry.Number,
                                             Price=entry.Price,
                                             Popularity=entry.Popularity, UpdateStr=entry.UpdateStr, Market=entry.Market, Sort=entry.Sort)
             connection.execute(ins)
         trans.commit()
     except Exception,e:
         trans.rollback()
Beispiel #3
0
 def updateentrys(self, entrys):
     connection = db.engine.connect()
     trans = connection.begin()
     try:
         for entry in entrys:
             stmt = ShoeTable.update(). \
                 where(ShoeTable.c.Id == entry.Id). \
                 values(Title=entry.Title, Url=entry.Url, Number=entry.Number,
                        Price=entry.Price,
                        Sort=entry.Sort,
                        Popularity=entry.Popularity, UpdateStr=entry.UpdateStr, Market=entry.Market)
             connection.execute(stmt)
         trans.commit()
     except Exception, e:
         trans.rollback()
Beispiel #4
0
 def deleteentry(self, entry):
     connection = db.engine.connect()
     connection.execute(ShoeTable.delete().where(ShoeTable.c.Id == entry.Id))
Beispiel #5
0
 def updateentry(self, entry):
     connection = db.engine.connect()
     stmt = ShoeTable.update(). \
         where(ShoeTable.c.Id == entry.Id). \
         values(Title=entry.Title, Url=entry.Url, Number=entry.Number, Price=entry.Price, Popularity=entry.Popularity, UpdateStr=entry.UpdateStr, Market=entry.Market, Sort=entry.Sort)
     connection.execute(stmt)
Beispiel #6
0
 def addentry(self, entry):
     ins = ShoeTable.insert().values(Id=entry.Id, Title=entry.Title, Url=entry.Url, Number=entry.Number, Price=entry.Price,
                                     Popularity=entry.Popularity, UpdateStr=entry.UpdateStr, Market=entry.Market, Sort=entry.Sort)
     conn = db.engine.connect()
     conn.execute(ins)
Beispiel #7
0
 def deleteall(self):
     connection = db.engine.connect()
     connection.execute(ShoeTable.delete())