Chase Down My Dream

Life, Dream

  • Home
  • About
  • Sample Page
Twitter Facebook Sina RSS

Micolog 导入文章评论时间的问题

Posted on August 30, 2009 by stingrey
2 CommentsLeave a comment

Cloud 前段时间把百度空间的文章导了过来,导的过程发现不论格式如何,文章评论时间都会变成Google App Engine的系统时间。感到有些悲壮了,评论的排序都乱了……

先是在导入文章格式上找原因,之后才开始在各个模块中找。查到admin.py才发现导入文章xml的模块根本就没有用到评论时间。

# 大概在215行的地方
for com in next['comments']:     comment=Comment(date=com['date'], <---添加date项                                    author=com['author'],                                    content=com['content'],                                    entry=entry)     try:          comment.email=com['email']          comment.weburl=com['weburl']     except:          pass          comment.save()     self.write(simplejson.dumps(('entry',next['title'],True)))
# 大概在375行的地方comment=dict(date=datetime.strptime(com.findtext(wpns+'comment_date'),                                                            "%Y-%m-%d %H:%M:%S"),<---添加date项                      author=com.findtext(wpns+'comment_author'),                      content=com.findtext(wpns+'comment_content'),                      email=com.findtext(wpns+'comment_author_email'),                      weburl=com.findtext(wpns+'comment_author_url')                 )

修改之后,只要文章评论时间格式”%Y-%m-%d %H:%M:%S”这样的,就能正常导入了。

Categories: Google App Engine | Tags: Micolog
Micolog 添加评论回复邮件通知功能
Micolog 文章摘要(more…)链接的bug

2 Responses to “Micolog 导入文章评论时间的问题”

  1. rainman says:
    February 22, 2010 at 09:26

    最近也开始玩gae,在你的blog上也借鉴了不少东西,不知你显示在url左边的图片是怎么做上去的,还有不只你有没有在google的网站管理员工具中上传过sitemap,我的blog建了大概半个月,一直没有被搜索引擎索引,不知道是不是太心急了,希望能与你交换链接

    Reply
  2. Stingrey says:
    February 22, 2010 at 09:49

    @rainman: 你指的是网站的favicon吗?只要更换Micolog文件夹下一个图片文件夹中的favicon图标,然后上传就可以了。ps: 链接交换done

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

*

*


question razz sad evil exclaim smile redface biggrin surprised eek confused cool lol mad twisted rolleyes wink idea arrow neutral cry mrgreen

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

  • Recent Posts

    • 一年了,我回来了
    • Un Senso Di Te
    • 好雨时节
    • 虎年来在追昔时
    • 无题
  • Recent Comments

    • hzqtc on 一年了,我回来了
    • aaahexing on Un Senso Di Te
    • RainFlying on 好雨时节
    • Stingrey on 秦时明月,侠骨柔情
    • hzqtc on 被拒了~
  • Archives

    • November 2011
    • June 2010
    • April 2010
    • February 2010
    • December 2009
    • November 2009
    • October 2009
    • September 2009
    • August 2009
    • July 2009
    • June 2009
    • May 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • September 2008
    • July 2008
  • Categories

    • C#
    • Google App Engine
    • Hello Program
    • Linux
    • Linux and Windows
    • Micolog
    • Misc
    • Mojo
    • Music and Movie
    • Windows
    • 另一个自己
    • 玩意儿
    • 生活
  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org
© Chase Down My Dream. Proudly Powered by WordPress | Nest Theme by YChong