Exemple #1
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()
Exemple #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()
Exemple #3
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()
Exemple #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()
Exemple #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()
Exemple #6
0
 def get(self, id=0):
     if id:
         return self.succ(Contract.get(id))
     return self.succ(Contract.select(_orders=[Contract.id.desc()]))
Exemple #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()
Exemple #8
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()
Exemple #9
0
 def get(self, id=0):
     if id:
         return self.succ(Contract.get(id))
     return self.succ(Contract.select(_orders=[Contract.id.desc()]))
Exemple #10
0
            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()