示例#1
0
文件: contract.py 项目: xutaoding/bmp
    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()
示例#2
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()
示例#3
0
文件: contract.py 项目: xutaoding/bmp
    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()
示例#4
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()
示例#5
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()
示例#6
0
 def get(self, id=0):
     if id:
         return self.succ(Contract.get(id))
     return self.succ(Contract.select(_orders=[Contract.id.desc()]))
示例#7
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()

    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 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()


if __name__ == "__main__":
    print Contract.select()
示例#8
0
文件: contract.py 项目: xutaoding/bmp
    def delete(self, id):
        contract = Contract.delete(id,auto_commit=False)
        Alert().delete(contract,[timedelta(30), timedelta(60)])

        db.session.commit()
        return self.succ()
示例#9
0
文件: contract.py 项目: xutaoding/bmp
 def get(self, id=0):
     if id:
         return self.succ(Contract.get(id))
     return self.succ(Contract.select(_orders=[Contract.id.desc()]))
示例#10
0
文件: contract.py 项目: xutaoding/bmp
            return self.succ(Contract.get(id))
        return self.succ(Contract.select(_orders=[Contract.id.desc()]))

    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 delete(self, id):
        contract = Contract.delete(id,auto_commit=False)
        Alert().delete(contract,[timedelta(30), timedelta(60)])

        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()


if __name__ == "__main__":
    print Contract.select()