def get(self):
     logger = logging.getLogger(__name__)
     templatepath = os.path.dirname(__file__) + '/../templates/'
     html = template.render(templatepath + '01uberheader.html', {'title':'Ubertool'})
     html = html + template.render(templatepath + '02uberintroblock_nomodellinks.html', {'title2':'Select Chemical'})
     html = html + template.render (templatepath + '03ubertext_links_left.html', {})                
     html = html + template.render(templatepath + '04uberinput_start.html', {'model':'select_chemical'})
     cas = CASGql("apppest:cas","CAS")
     chemicalNames = cas.getAllChemicalNamesUTF8()
     logger.info(len(chemicalNames))
     html = html + template.render(templatepath + 'chemical_selection_jqueryui.html', {'ChemicalNames':chemicalNames})
     html = html + str(select_chemical_db.SelectChemicalInp())
     html = html + template.render(templatepath + '04uberinput_end.html', {'sub_title': 'Submit'})
     html = html + template.render(templatepath + '06uberfooter.html', {'links': ''})
     self.response.out.write(html)
Пример #2
0
 def get(self):
     cas = CASGql()
     results = cas.getAllChemNamesCASNumsMongoJson()
     chem_json = simplejson.dumps(results)
     self.response.headers['Content-Type'] = 'application/json'
     self.response.out.write(chem_json)
Пример #3
0
 def get(self,casNumber):
     cas = CASGql()
     results = cas.getChemicalNameFromCASNumber(casNumber)
     chem_json = simplejson.dumps({"chemical_name":results})
     self.response.headers['Content-Type'] = 'application/json'
     self.response.out.write(chem_json)