Example #1
0
    def post(self):
        new_hfwwg = hfwwgDB.Sighting()

        # 初始化
        new_hfwwg.name = self.request.get("name")
        new_hfwwg.email = self.request.get("email")
        new_hfwwg.date = self.request.get("date")
        new_hfwwg.time = self.request.get("time")
        new_hfwwg.location = self.request.get("location")
        new_hfwwg.fin_type = self.request.get("fin_type")
        new_hfwwg.whale_type = self.request.get("whale_type")
        new_hfwwg.blow_type = self.request.get("blow_type")
        new_hfwwg.wave_type = self.request.get("wave_type")
        new_hfwwg.which_user = users.get_current_user()

        # 保存数据
        new_hfwwg.put()

        # 弹出提示信息
        html = template.render("templates/header.html", {"title":"Thank you!"})
        html = html + "<p>Thank you for providing your sighting data</p>"
        html = html + template.render("templates/footer.html", {"links":"Enter <a href='/'>another birth</a>"})

        # 响应提示信息
        self.response.write(html)
Example #2
0
    def post(self):

        new_sighting = hfwwgDB.Sighting()

        new_sighting.name = self.request.get('name')
        new_sighting.email = self.request.get('email')
        new_sighting.date = self.request.get('date')
        new_sighting.time = self.request.get('time')
        new_sighting.location = self.request.get('location')
        new_sighting.fin_type = self.request.get('fin_type')
        new_sighting.whale_type = self.request.get('whale_type')
        new_sighting.blow_type = self.request.get('blow_tipe')
        new_sighting.wave_type = self.request.get('wave_type')
        new_sighting.which_user = users.get_current_user()

        new_sighting.put()

        html = template.render('templates/header.html',
                               {'title': 'Thank You!'})
        html = html + "<p> Thank You for providing your sighting data. </p>"
        html = html + template.render(
            'templates/footer.html',
            {'links': 'Enter <a href="/"> another sighting </a>.'})

        self.response.out.write(html)
Example #3
0
 def post(self):
     new_sighting = hfwwgDB.Sighting(
     )  # create a new Sighting object to hold your data
     new_sighting.name = self.request.get('name')
     new_sighting.email = self.request.get('email')
     new_sighting.date = self.request.get('date')
     new_sighting.time = self.request.get('time')
     new_sighting.location = self.request.get('location')
     new_sighting.fin_type = self.request.get('fin_type')
     new_sighting.whale_type = self.request.get('whale_type')
     new_sighting.blow_type = self.request.get('blow_type')
     new_sighting.wave_type = self.request.get('wave_type')
     #new_sightine.which_user = users.get_current_user()	# this line includes the Google ID of the currently logged-in user
     new_sighting.put()  # store your data in the GAE datastore
     html = template.render('templates/header.html',
                            {'title': 'Thank you!'})
     html = html + "<p>Thank you for providing your sighting data.</p>"
     html = html + template.render(
         'templates/footer.html',
         {'links': 'Enter <a href="/">another sighting</a>.'})
     self.response.out.write(html)