예제 #1
0
 def get(self):
     params=self.check_login('legislators')
     chamber=self.request.get("q")
     if chamber!="house" and chamber!="senate" and chamber:
         self.redirect('/')
     else:
         params['chamber']='upper'
         params['chamber_name']="Senate"
         if self.request.get("q")=="house":
             params['chamber']='lower'
             params['chamber_name']='House'
         page=get_contents_of_url(aws_output+'legislators/'+params['chamber'])
         if page:
             self.write(page)
         else:
             params['legislators']=getLegislatorsByChamber(params['chamber'])
             params['search_page']="True"
             self.render(current_legislators_page, **params)
예제 #2
0
 def get(self):
     params=self.check_login('/aws/legislators')
     chamber=self.request.get("q")
     if chamber!="house" and chamber!="senate" and chamber:
         self.redirect('/')
     else:
         params['chamber']='upper'
         params['chamber_name']="Senate"
         if self.request.get("q")=="house":
             params['chamber']='lower'
             params['chamber_name']='House'
         k=getKeyFromAWS('output/legislators/'+params['chamber'])
         if k==None:
             params['legislators']=getLegislatorsByChamber(params['chamber'])
             params['search_page']="True"
             k = getAWSKey('output/legislators/'+params['chamber'])
             k.set_contents_from_string(render_str(current_legislators_page, **params))
             k.set_acl('public-read')
         self.write(k.get_contents_as_string())
예제 #3
0
파일: main.py 프로젝트: ertanuj96/mnlegV2
 def get(self):
     params = self.check_login('legislators')
     chamber = self.request.get("q")
     if chamber != "house" and chamber != "senate" and chamber:
         self.redirect('/')
     else:
         params['chamber'] = 'upper'
         params['chamber_name'] = "Senate"
         if self.request.get("q") == "house":
             params['chamber'] = 'lower'
             params['chamber_name'] = 'House'
         page = get_contents_of_url(aws_output + 'legislators/' +
                                    params['chamber'])
         if page:
             self.write(page)
         else:
             params['legislators'] = getLegislatorsByChamber(
                 params['chamber'])
             params['search_page'] = "True"
             self.render(current_legislators_page, **params)
예제 #4
0
파일: main.py 프로젝트: ertanuj96/mnlegV2
 def get(self):
     params = self.check_login('/aws/legislators')
     chamber = self.request.get("q")
     if chamber != "house" and chamber != "senate" and chamber:
         self.redirect('/')
     else:
         params['chamber'] = 'upper'
         params['chamber_name'] = "Senate"
         if self.request.get("q") == "house":
             params['chamber'] = 'lower'
             params['chamber_name'] = 'House'
         k = getKeyFromAWS('output/legislators/' + params['chamber'])
         if k == None:
             params['legislators'] = getLegislatorsByChamber(
                 params['chamber'])
             params['search_page'] = "True"
             k = getAWSKey('output/legislators/' + params['chamber'])
             k.set_contents_from_string(
                 render_str(current_legislators_page, **params))
             k.set_acl('public-read')
         self.write(k.get_contents_as_string())