예제 #1
0
파일: main.py 프로젝트: ertanuj96/mnlegV2
 def get(self):
     params = self.check_login('districts')
     if 'loggedin_user' not in params:
         self.redirect('/signup')
     else:
         dists = getAllDistricts()
         house_hpvi = getHPVIbyChamber('lower')
         senate_hpvi = getHPVIbyChamber('upper')
         for d in dists:
             if d['chamber'] == 'upper':
                 hpvi = senate_hpvi.get(d['name'])
             elif d['chamber'] == 'lower':
                 hpvi = house_hpvi.get(d['name'])
             addDistrictToParse(d['boundary_id'], hpvi)
예제 #2
0
 def get(self):
     params=self.check_login('districts')
     if 'loggedin_user' not in params:
         self.redirect('/signup')
     else:
         dists=getAllDistricts()
         house_hpvi=getHPVIbyChamber('lower')
         senate_hpvi=getHPVIbyChamber('upper')
         for d in dists:
             if d['chamber']=='upper':
                 hpvi=senate_hpvi.get(d['name'])
             elif d['chamber']=='lower':
                 hpvi=house_hpvi.get(d['name'])
             addDistrictToParse(d['boundary_id'],hpvi)
예제 #3
0
파일: main.py 프로젝트: ertanuj96/mnlegV2
 def get(self):
     params = self.check_login('aws/districts')
     k = getKeyFromAWS('output/districts/front')
     if k == None:
         self.write('Page not found, uploading...<br>')
         params['districts'] = getAllDistricts()
         params['sen_hpvi'] = getHPVIbyChamber('upper', True)
         params['house_hpvi'] = getHPVIbyChamber('lower', True)
         params['senate'] = [39, 28]
         params['house'] = [73, 61]
         k = Key(b)
         k.key = 'output/districts/front'
         k.set_contents_from_string(render_str(districts_page, **params))
         k.set_acl('public-read')
     self.write(k.get_contents_as_string())
예제 #4
0
 def get(self):
     params=self.check_login('aws/districts')
     k=getKeyFromAWS('output/districts/front')
     if k==None:
         self.write('Page not found, uploading...<br>')
         params['districts']=getAllDistricts()
         params['sen_hpvi']=getHPVIbyChamber('upper',True)
         params['house_hpvi']=getHPVIbyChamber('lower',True)
         params['senate']=[39,28]
         params['house']=[73,61]
         k = Key(b)
         k.key = 'output/districts/front'
         k.set_contents_from_string(render_str(districts_page, **params))
         k.set_acl('public-read')
     self.write(k.get_contents_as_string())