예제 #1
0
    def post(self):
        title = self.request.get("title")
        type = self.request.get("type")
        simpledocument = SimpleDocument()
        if title != "":
            a = ""
        if type != "":
            key = {"events": "Event", "venues": "Venue"}.get(type)
            if key == None:
                key = "Event"

        if key == "":
            key = "Event"

        # self.response.out.write('Key %s' %key)
        # return

        results = simpledocument.query_document(ndb.Key("Category", key))
        template_values = {"results": results}
        self.render("index", template_values)
예제 #2
0
 def get(self):
     simpledocument = SimpleDocument()
     results = simpledocument.query_document(ndb.Key("Category", "Event"))
     template_values = {"title": "", "content": "", "results": results}
     self.render("index", template_values)