App Engine Python:AttributeError:' module'对象没有属性' Stock'

时间:2012-03-27 20:02:59

标签: python google-app-engine memcached

我在制作中遇到此错误。在localhost上运行良好。

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/s~ordenaacoes/2.357768699674437719/controllers/mainh.py", line 74, in get
    'stocks': goodStocks(),
  File "/base/data/home/apps/s~ordenaacoes/2.357768699674437719/controllers/mainh.py", line 108, in goodStocks
    goodStocks = memcache.get("goodStocks")
  File "/base/python_runtime/python_lib/versions/1/google/appengine/api/memcache/__init__.py", line 574, in get
    results = rpc.get_result()
  File "/base/python_runtime/python_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", line 592, in get_result
    return self.__get_result_hook(self)
  File "/base/python_runtime/python_lib/versions/1/google/appengine/api/memcache/__init__.py", line 639, in __get_hook
    self._do_unpickle)
  File "/base/python_runtime/python_lib/versions/1/google/appengine/api/memcache/__init__.py", line 271, in _decode_value
    return do_unpickle(value)
  File "/base/python_runtime/python_lib/versions/1/google/appengine/api/memcache/__init__.py", line 412, in _do_unpickle
    return unpickler.load()
  File "/base/python_runtime/python_dist/lib/python2.5/pickle.py", line 852, in load
    dispatch[key](self)
  File "/base/python_runtime/python_dist/lib/python2.5/pickle.py", line 1084, in load_global
    klass = self.find_class(module, name)
  File "/base/python_runtime/python_dist/lib/python2.5/pickle.py", line 1119, in find_class
    klass = getattr(mod, name)
AttributeError: 'module' object has no attribute 'Stock'

股票是我的一类模特。我也在localhost上测试了python 2.5。

给出错误的行是访问memcache(获取功能) 我已经改变了项目,也许我在memcache中输入的数据类型也不同。我有办法清理memcache上的数据吗?

有什么想法吗?

2 个答案:

答案 0 :(得分:2)

从版本1.6.4开始,管理控制台中有一个Memcache Viewer。它包括一个“Flush Cache”按钮,它应该完全符合您的需要。

答案 1 :(得分:1)

很可能你在memcache中有一个与新代码不匹配的pickle版本的对象。这是关于刷新内存缓存的一个老问题,答案应该适用于你的情况:

How can I have Google App Engine clear memcache every time a site is deployed?