Beispiel #1
0
    def GET(self):
        loans = borrow.get_all_loans()

        # Preload books
        web.ctx.site.get_many([loan['book'] for loan in loans])

        return render_template("admin/loans", loans, None)
Beispiel #2
0
    def GET(self):
        loans = borrow.get_all_loans()

        # Preload books
        web.ctx.site.get_many([loan['book'] for loan in loans])

        return render_template("admin/loans", loans, None)
Beispiel #3
0
 def POST(self):
     i = web.input(action=None)
     
     # Sanitize
     action = None
     actions = ['updateall']
     if i.action in actions:
         action = i.action
         
     if action == 'updateall':
         borrow.update_all_loan_status()
     loans = borrow.get_all_loans()
     raise web.seeother(web.ctx.path) # Redirect to avoid form re-post on re-load
Beispiel #4
0
 def GET(self):
     loans = borrow.get_all_loans()
     return render_template("admin/loans", loans, None)