我想检索一些我放在数据存储中的模型类名为“Ani”的值,我尝试使用下面的脚本来做到这一点,但我遇到了问题。有人可以请帮助我吗
import random
import getpass
import sys
# Add the Python SDK to the package path.
# Adjust these paths accordingly.
sys.path.append('/root/google_appengine')
sys.path.append('/root/google_appengine/lib/yaml/lib')
from google.appengine.ext.remote_api import remote_api_stub
from google.appengine.ext import db
import models
# Your app ID and remote API URL path go here.
APP_ID = 'silasanio'
REMOTE_API_PATH = '/remote_api'
def auth_func():
email_address = raw_input('Email address: ')
password = getpass.getpass('Password: ')
return email_address, password
def initialize_remote_api(app_id=APP_ID,
path=REMOTE_API_PATH):
remote_api_stub.ConfigureRemoteApi(
app_id,
path,
auth_func)
remote_api_stub.MaybeInvokeAuthentication()
def main():
initialize_remote_api()
Meanvalue = []
result = db. ("SELECT * FROM Ani ORDER BY date DESC LIMIT 1")
for res in result:
Meanvalue = res.mean
std_dev = res.stdev
print(mean)
if __name__ == '__main__':
main()
我收到以下错误:
提出KindError('没有针对种类\'%s \'''%kind的实现) google.appengine.ext.db.KindError:没有针对'Ani'的实现
拜托,我需要一些帮助。
由于
答案 0 :(得分:1)
您需要导入定义类Ani
的文件,然后才能对数据运行查询。