handler.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:Ushio 作者: Hanaasagi 项目源码 文件源码
def post(self, tid):
        topic = {
            'title': self.get_body_argument('title', ''),
            'content': self.get_body_argument('content', ''),
            'price': self.get_body_argument('price', 0)
        }
        model = TopicModel()
        if model(topic):
            try:
                tid = ObjectId(tid)
            except:
                self.cache['topic'] = topic
                self.custom_error('????????????')
            yield self.db.topic.update({
                '_id': tid
            }, {
                '$set': topic
            })
            self.redirect('/topics/{}'.format(tid))
        else:
            self.custom_error()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号