def returnDevice(self, lender, doer): lendlog = LendLog() lendlog.setDevice(self.__device.device_id) lendlog.setLender(lender) lendlog.setDoer(doer) lendlog.returnDevice(self.__device.lend_log_id) self.__device.lend_log_id = None db.session.add(self.__device) db.session.commit()
def lendDevice(self, lender, doer): lendlog = LendLog() lendlog.setDevice(self.__device.device_id) lendlog.setLender(lender) lendlog.setDoer(doer) lendlog.lendDevice()