Beispiel #1
0
    def post(self):
        content = self.request.get('content')
        for line in content.split('\n'):
            spelling, meaning = line.split(',')

            word = Word()
            word.spelling = spelling
            word.meaning = meaning

            word.put()

        self.redirect('/words')
Beispiel #2
0
 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')