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()
评论列表
文章目录