Python模糊查找
时间:2010-12-09
来源:互联网
Python模糊查找报了一个如下错误:
Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 511, in __call__
handler.get(*groups)
File "C:\Program Files\Google\google_appengine\demos\appmmggoo\photo.py", line 72, in get
searchType = db.Key(string.atio(searchType))
AttributeError: 'module' object has no attribute 'atio'
查找的方法如下:
class PhotoInfoList(PublicPage):
def get(self,page):
searchType = self.request.get('searchType')
radio = self.request.get('radio')
findDegree = self.request.get('findDegree')
index=0 if page=="" else int(page)
if (radio == 'imageId' or radio == ''):
if (findDegree == '1' or findDegree == ''):
if (searchType ==''):
images = methods.getAllImages(index)
prev,next=methods.getPageing(len(images), index)
template_value={"images":images[:16],"prev":prev,"next":next,"index":index}
self.render('html/photoManage/photoInfoList.html', template_value)
else:
image = methods.getImage(searchType)
template_value={"image":image,}
self.render('html/photoManage/photoInfoList_1.html', template_value)
elif (findDegree == '2'):
if (searchType ==''):
images = methods.getAllImages(index)
prev,next=methods.getPageing(len(images), index)
template_value={"images":images[:16],"prev":prev,"next":next,"index":index}
self.render('html/photoManage/photoInfoList.html', template_value)
else:
searchType = db.Key(string.atio(searchType))#这一行报错
images = Entity.Gql("Where __key__=:1" ,searchType)
template_value={"images":images,}
self.render('html/photoManage/photoInfoList.html', template_value)
那里出错了呢?请高手指点!!
作者: xieyingan 发布时间: 2010-12-09
string 没有atio 只能atoi
searchType = db.Key(string.atoi(searchType))
searchType = db.Key(string.atoi(searchType))
作者: cym64039 发布时间: 2010-12-09
引用 1 楼 cym64039 的回复:
string 没有atio 只能atoi
searchType = db.Key(string.atoi(searchType))
不是这个错误呢,这里的确是写错了!改过来之后还是错! string 没有atio 只能atoi
searchType = db.Key(string.atoi(searchType))
作者: xieyingan 发布时间: 2010-12-09
认真点。改过来之后还是一样的错吗?
作者: iambic 发布时间: 2010-12-09
引用 3 楼 iambic 的回复:
认真点。改过来之后还是一样的错吗?
还是提示这一行出错,错误的原因还是在这个string.atoi这里! 认真点。改过来之后还是一样的错吗?
作者: xieyingan 发布时间: 2010-12-09
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28