def post(self): user = users.get_current_user() wordlist = WordList(owner=user) wordlist.put() self.response.headers['Content-Type'] = 'application/json' # FIXME: should use JSON printer self.response.out.write('{"ListId": "%s"}' % wordlist.key())
def post(self): user = users.get_current_user() wordlist = WordList(owner=user) wordlist.put() listid = wordlist.key() json = '{"ListId": "%s"}' % listid self.response.headers["Content-Type"] = "application/json" self.response.out.write(json)
def get(self): i = 0 for wordlist in wordlists: wl = WordList(name="wordlist%02d" % i, owner=users.get_current_user()) wl.put() for spelling, meaning in wordlist: w = Word(spelling=spelling, meaning=meaning) w.put() m = WordMember(wordlist=wl, word=w) m.put() i += 1 self.redirect('/words')