示例#1
0
文件: search.py 项目: chihchun/bebebe
    def index(self):
        word = self.params.get('word')
        if not word:
            raise "no word!"

        user = get_user_or_letlogin(self,'/search/?word=%s' % word)
        log = SearchLog(word=word, user=user)
        log.put()

        voca = Vocabulary(key_name=user.email+'_'+word, word=word, user=user)
        voca.put()

        query_url = YahooDictionary.get_search_url(word)
        self.redirect(query_url)
示例#2
0
文件: user.py 项目: chihchun/bebebe
 def home(self):
     self.user = get_user_or_letlogin(self, '/user/home')
     self.vocabularies = Vocabulary.gql("WHERE user=:1", self.user).fetch(200)