开发者

app engine python submit+display

im new to google app engine with python here is my html file where in jquery i write this

 $("a.display").colorbox({iframe:true, innerWidth:800, innerHeight:550});

on this add button i want my current data save in database and then popup the saved record which i added. my ques is how can i save data and then display in a lightbox popup.??

class DisplayAddHandler(webapp.RequestHandler):
    def get(self):
        self.response.out.write("worksss")

        data_key_display = self.request.get('patients_id')
        key = self.request.get('key')
        patient_print_display = PatientInfo.get_by_id(int(data_key_display),parent=None)
        results_print_display = db.GqlQuery("SEL开发者_JAVA百科ECT * FROM PatientMeds WHERE patientinfo_ID=" + data_key_display)
        results_patientalerts_print_display = db.GqlQuery("SELECT * FROM PatientAlerts WHERE patientinfo_ID=" + data_key_display)

    template_values = {
    'patient_display': patient_print_display,
    'meds_display': results_print_display,
    'alert_display': results_patientalerts_print_display,

    }

    path = os.path.join(os.path.dirname(__file__), 'display.html')        
    self.response.out.write(template.render(path, template_values))

now i want when i save record.. it will saved successfully and after saving it will display the record which i have added on one click.(i mean on submit button it will save record + display) m having confusion as how can i saved and display on same button.. plz help me.. thanx in advance...


You should use either jquery form plugin or .ajax to submit the data and then in the success function add your code to display the colorbox.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜