コード例 #1
0
    def post(self, user, code):
        sentence = self.request.get('sentence')
        new_sentence = Sentence(
            key_name    = md5.new(sentence.encode('utf-8')).hexdigest(),
            body        = sentence,
            translation = self.request.get('translation'),
            words       = self.request.get('words'),
            rate        = int(self.request.get('rate')),
            )
        new_sentence.put()

        return self.redirect(self.request.url)
コード例 #2
0
    def get(self, user, code, point):
        sentence = Sentence.get_by_key_name(code)
        if not sentence:
            return self.response.out.write('NG')

        sentence.rate = int(point)
        sentence.put()
        return self.response.out.write('OK')
コード例 #3
0
    def get(self, user, code):
        data = Sentence.get_by_key_name(code)
        if not data:
            self.redirect("/toeic800/new")

        t = env.get_template('toeic800_edit_sentence.html')
        tvars = {"user": user,
                 "sentence": data,
                 "name":'satoshi'}
        return self.response.out.write(t.render(T=tvars))