Exemplo n.º 1
0
    def get(self):
        wordlists = WordList.all().filter('owner =', users.get_current_user())

        wordlist_key = self.request.get('wordlist_key')
        if wordlist_key:
            wordlist = WordList.get(wordlist_key)
        else:
            wordlist = wordlists and wordlists.get()

        # FIXME: an exception will be thrown if the user has no wordlists
        template_values = {'words': wordlist.words, 'wordlists': wordlists, 'wordlist_name': wordlist.name}

        path = join(dirname(dirname(dirname(__file__))), 'template', 'words.html')
        self.response.out.write(template.render(path,template_values))