Пример #1
0
	def lend(self, borrowerID, date = None):
		import datetime
		borrower = UserAccount.getuser(borrowerID)
		owner = UserAccount.get_by_id(self.owner.id())
		self.borrower = borrower.key
		if(date):
			self.due_date = datetime.datetime.strptime(date, '%Y-%m-%d');
		else:
			self.due_date = datetime.datetime.now() + datetime.timedelta(days=int(owner.lending_length))
Пример #2
0
	def get_borrower(self):
		borrower = UserAccount.get_by_id(self.borrower.id())
		return borrower
Пример #3
0
	def get_owner(self):
		owner = UserAccount.get_by_id(self.owner.id())
		return owner.name