def put(self): submit = self.request() cert = Cert.edit(submit, auto_commit=False) Alert().add("证书", cert, cert.end_time, timedelta(days=20)) db.session.commit() return self.succ()
def post(self): submit = self.request() stock = Stock.add(submit, auto_commit=False) Alert().add("库存", stock, stock.warranty_time, timedelta(days=30)) db.session.commit() return self.succ()
def delete(self): submit = self.request() cert = Cert.delete(submit["ids"].split(","), auto_commit=False) Alert().delete(cert, timedelta(days=20)) db.session.commit() return self.succ()
def post(self): submit = self.request() contract = Contract.add(submit, auto_commit=False) Alert().add("合同", contract, contract.end_time, [timedelta(30), timedelta(60)]) db.session.commit() return self.succ()
def put(self, sid): submit = self.request() submit["id"] = sid stock = Stock.edit(submit, auto_commit=False) Alert().add("库存", stock, stock.warranty_time, timedelta(days=30)) db.session.commit() return self.succ()
def put(self, id): submit = self.request() submit["id"] = id contract = Contract.edit(submit, auto_commit=False) Alert().add("合同", contract, contract.end_time, [timedelta(30), timedelta(60)]) db.session.commit() return self.succ()
def delete(self, id): contract = Contract.delete(id, auto_commit=False) Alert().delete(contract, [timedelta(30), timedelta(60)]) db.session.commit() return self.succ()
def delete(self, sid): stock = Stock.delete(sid, auto_commit=False) Alert().delete(stock, [timedelta(30), timedelta(60)]) db.session.commit() return self.succ()