Esempio n. 1
0
    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()
Esempio n. 2
0
    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()
Esempio n. 3
0
    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()
Esempio n. 4
0
    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()
Esempio n. 5
0
    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()
Esempio n. 6
0
    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()
Esempio n. 7
0
    def delete(self, id):
        contract = Contract.delete(id, auto_commit=False)
        Alert().delete(contract, [timedelta(30), timedelta(60)])

        db.session.commit()
        return self.succ()
Esempio n. 8
0
    def delete(self, sid):
        stock = Stock.delete(sid, auto_commit=False)
        Alert().delete(stock, [timedelta(30), timedelta(60)])

        db.session.commit()
        return self.succ()