def post(self):
        title = self.request.get("title")
        art = self.request.get("art")

        if title and art:
            a = Art(title=title, art=art)
            a.put()
            self.redirect("/")
        else:
            error = "We need both a title and artwork!"
            self.render("art.html", error=error)
Esempio n. 2
0
    def post(self):
        title = self.request.get("title")
        category = self.request.get("category")
        art = self.request.get("art")

        if (title and category and art):
            a = Art(title=title, category=category, art=art)
            a.put()
            self.redirect("/")
        else:
            error = "Invalid inputs!"
            self.render_front(title, art, error)
Esempio n. 3
0
    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)
Esempio n. 4
0
    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 )
Esempio n. 5
0
    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)