示例#1
0
def tracker():
    form = Waterer(request.form)
    if request.method=="POST":
        fire = form.water.data
        fire2= form.water2.data
        fire3= form.water3.data

        fire6= form.note1.data
        fire7= form.note2.data
        fire8 = form.pain1.data


        fire10= Water(fire,fire2,fire3,fire6,fire7,fire8)

        water_db = root.child('water')
        water_db.push({
            'Water': fire10.get_water(),
            "Water2": fire10.get_water2(),
            "Water3": fire10.get_water3(),
            "Note1": fire10.get_note1(),
            "Note2": fire10.get_note2(),
            "Pain1": fire10.get_pain1(),

        })
    return render_template('tracker.html',form=form)
示例#2
0
def update_wiki(id):
    form=Waterer(request.form)
    if request.method=='POST':
        general=form.water2.data
        symptoms=form.water.data
        surgery=form.water3.data
        types=form.note1.data
        longtermeffect=form.pain1.data
        stay=form.note2.data

        wikiupdate=Water(symptoms,general,surgery,types,stay,longtermeffect)
        wikiupdate_db= root.child('water/'+id)

        wikiupdate_db.set({
            "Water2":wikiupdate.get_water2(),
            "Water":wikiupdate.get_water(),
            "Water3":wikiupdate.get_water3(),
            "Note1":wikiupdate.get_note1(),
            "Pain1":wikiupdate.get_pain1(),
            'Note2':wikiupdate.get_note2(),
        })

        flash('Magazine Updated Sucessfully.', 'success')

        return redirect(url_for('diabetes'))
    else:
        url = 'water/'+id
        wikidata=root.child(url).get()

        if wikidata['Water'] != " ":
            wikiadmin= Water(wikidata['Water'],wikidata['Water2'],wikidata['Water3'],wikidata['Note1'],wikidata['Note2'],wikidata['Pain1'])
            wikiadmin.set_pubid((id))
            form.water2.data=wikiadmin.get_water2()
            form.water.data=wikiadmin.get_water()
            form.water3.data=wikiadmin.get_water3()
            form.note1.data=wikiadmin.get_note1()
            form.pain1.data=wikiadmin.get_pain1()
            form.note2.data=wikiadmin.get_note2()

        return render_template('updatewiki.html',form=form)