作为初学者,跟着书本试着编写个blog程序,好不容易运行成功,试着添加blog时发现,保存好的blog 的title为保存时的内容,而content为none,而且index.html的代码中不能写汉字,要不然就是乱码。。。
各位大虾,再帮在下一把吧!不胜感激!

利用gae编写blog程序时,添加blog出问题。
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
4条回答 默认 最新
- u010804832 2010-10-10 12:05关注
[code="python"]
def post(self):
entry = Entry()
entry.title = self.request.get('content') # 你把content放到title里了,content字段没有赋值,当然为空if users.get_current_user(): entry.author = users.get_current_user() entry.put() self.redirect('/')
[/code]
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报