예제 #1
0
파일: main.py 프로젝트: PEZ/TreasureHunt
 def post(self, hunt_key_str):
     title = self.request.get('title')
     text_clue = self.request.get('text_clue')
     hunt = ndb.Key(urlsafe=urllib.unquote(hunt_key_str)).get()
     if hunt is not None and hunt.is_of_class_name('THHunt'):
         try:
             checkpoint = THCheckpoint(hunt=hunt.key, title=title, text_clue=text_clue)
             checkpoint.put()
             self.respond(checkpoint.as_dict())
         except Exception, e:
             logging.error('Error creating checkpoint for hunt %s: %s' % (hunt_key_str, e.message))
             raise
예제 #2
0
파일: th_hunt.py 프로젝트: PEZ/TreasureHunt
 def checkpoints_keys(self):
     from th_models.th_checkpoint import THCheckpoint
     return THCheckpoint.query(THCheckpoint.hunt == self.key).fetch(keys_only=True)