def GET(self, bill_id, format=None): if bill_id == "" or bill_id == "index": i = web.input(page=0) return bill_list(format, int(i.page)) try: b = schema.Bill.where(id=bill_id)[0] except IndexError: raise web.notfound out = apipublish.publish([b], format) if out: return out return render.bill(b)
def GET(self, bill_id, format=None): if bill_id == "" or bill_id == "index": i = web.input(page=0) return bill_list(format, int(i.page)) try: b = schema.Bill.where(id=bill_id)[0] except IndexError: raise web.notfound() out = apipublish.publish([b], format) if out: return out return render.bill(b)
def GET(self, bill_id, format=None): if bill_id == "" or bill_id == "index": i = web.input(page=0) return bill_list(format, int(i.page)) try: b = db.select('bill', where='id=$bill_id', vars=locals())[0] except IndexError: raise web.notfound b.sponsorname = polname_by_id(b.sponsor) b.interest_group_support = interest_group_support(bill_id) b.votes_by_party = votes_by_party(bill_id) out = apipublish.publish({ 'uri': 'http://watchdog.net/b/' + bill_id, 'type': 'Bill', 'session title summary sponsor' : apipublish.identity, 'interest_group_support': apipublish.table({ 'longname support': apipublish.identity}), }, [b], format) if out: return out return render.bill(b)