austgl / micolog

Automatically exported from code.google.com/p/micolog
MIT License
0 stars 0 forks source link

735版本评论排序为降序时文章显示404错误 #103

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
管理中,如果把评论排序 选为 
降序时,打开文章的具体页面时显示 404 错误
选择升序时就正常的,错误提示:
Traceback (most recent call last):
  File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 511, in __call__
    handler.get(*groups)
  File "/base/data/home/apps/snailsblog/1.345437218264231425/base.py", line 91, in _wrapper
    method(*args, **kwargs)
  File "/base/data/home/apps/snailsblog/1.345437218264231425/blog.py", line 223, in get
    comments=entry.get_comments_by_page(mp,self.blog.comments_per_page)
  File "/base/data/home/apps/snailsblog/1.345437218264231425/model.py", line 516, in get_comments_by_page
    return self.purecomments().fetch(psize,offset = (index-1) * psize)
  File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/db/__init__.py", line 1849, in fetch
    raw = raw_query.Get(limit, offset, rpc=rpc)
  File "/base/python_runtime/python_lib/versions/1/google/appengine/api/datastore.py", line 1253, in Get
    limit=limit, offset=offset, prefetch_count=limit, **kwargs)._Get(limit)
  File "/base/python_runtime/python_lib/versions/1/google/appengine/api/datastore.py", line 1188, in _Run
    str(exc) + '\nThis query needs this index:\n' + yaml)
NeedIndexError: no matching index found.
This query needs this index:
- kind: Comment
  properties:
  - name: ctype
  - name: entry
  - name: date
    direction: desc

Original issue reported on code.google.com by snailb...@gmail.com on 12 Oct 2010 at 3:42

GoogleCodeExporter commented 9 years ago
自己修改了,但是还是来这说一下 index.yaml 文件中添加
- kind: Comment
  properties:
  - name: ctype
  - name: entry
  - name: date
    direction: desc

Original comment by snailb...@gmail.com on 12 Oct 2010 at 3:52

GoogleCodeExporter commented 9 years ago
这个 index.yaml 里面已经有了啊 ,我记得已经给加进去了

Original comment by hongwei....@gmail.com on 12 Oct 2010 at 4:04