V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
lin
V2EX  ›  Project Babel

删除自发帖子时遇到的错误

  •  
  •   lin · 2011-12-30 17:04:20 +08:00 · 4722 次点击
    这是一个创建于 4472 天前的主题,其中的信息可能已经有所发展或是发生改变。
    在我网站 http://www.geekaa.com 删除一个帖子时返回:

    Traceback (most recent call last):
    File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/_webapp25.py", line 701, in __call__
    handler.get(*groups)
    File "/base/data/home/apps/geekaa3/1.355717407538880391/topic.py", line 1048, in get
    if member.level == 0 and (str(member.created_ts) == str(t)):
    AttributeError: 'Member' object has no attribute 'created_ts'

    topic.py 我是copy @Livid 在github上的文件。
    3 条回复    1970-01-01 08:00:00 +08:00
    Livid
        1
    Livid  
    MOD
       2011-12-30 17:06:07 +08:00
    你如果只是更新部分文件的话,你需要同时更新一下 v2ex/babel/__init__.py 里的数据模型定义。
    lin
        2
    lin  
    OP
       2011-12-30 17:30:17 +08:00
    @Livid 是这样的,我每次都是运行 git merge 来修改,可能之前我的 topic.py 有问题,结果每次发帖都错误,所以我单独copy了你这个文件。
    lin
        3
    lin  
    OP
       2011-12-31 15:17:12 +08:00
    @Livid 抱歉,这个是我疏忽,我改的时候漏了一段

    @property
    def username_lower_md5(self):
    return hashlib.md5(self.username_lower).hexdigest()

    @property
    def created_ts(self):
    return self.created.strftime("%s")

    但是现在虽然能弹出确认删除的对话框,但是问题是:
    点击后返回首页但是要删除的帖子还在。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3588 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 04:39 · PVG 12:39 · LAX 21:39 · JFK 00:39
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.