def GET(self): user = accounts.get_current_user() user.update_loan_status() loans = borrow.get_loans(user) return render['account/borrow'](user, loans)
def get_loan_count(self): return len(borrow.get_loans(self))
def get_loans(self): return borrow.get_loans(self.user)
def GET(self): user = web.ctx.site.get_user() user.update_loan_status() loans = borrow.get_loans(user) return render['account/borrow'](user, loans)
def update_loan_status(self): """Update the status of this user's loans.""" loans = borrow.get_loans(self) for resource_id in [loan['resource_id'] for loan in loans]: borrow.update_loan_status(resource_id)
def get_loans(self): self.update_loan_status() return borrow.get_loans(self)