def post(self): title = self.request.get("title") art = self.request.get("art") if title and art: a = Art(title = title, art = art, parent= art_key) coords = get_coords(self.request.remote_addr) if coords: a.coords = coords a.put() top_arts(True) self.redirect("/asciichan") else: error = "We need a title and some artwork!" self.render_front(title, art, error)
def post(self): title = self.request.get('title') art = self.request.get('art') if title and art: a = Art( title=title, art=art ) # lookup coordinates from import # if they have coordinates add them to the mapping # to get the ip self.request.remote_addr geopt = self.get_coords('4.2.2.2') if geopt: a.coords = geopt a.put() self.top_arts(True) self.redirect('/unit3') else: error = "we need both title and art" self.render_ascii(title, art, error )
def post(self): title = self.request.get("title") art = self.request.get("art") if title and art: p = Art(parent=art_key, title = title, art = art) #lookup the user's coordinates from their IP coords = get_coords(self.request.remote_addr) #if we have coordinates, add them to the art if coords: p.coords = coords p.put() self.redirect("/ascii") else: error = "we need both a title and some artwork!" self.render_front(error = error, title = title, art =art)