Django 1.2的App Engine中的基本模型在哪里?

时间:2013-12-19 10:56:58

标签: python django google-app-engine python-2.7

我正在尝试编写Exporter类,以便将本地开发数据存储区解压缩为CSV文件。我正在使用OS X 10.8.5和GAE SDK 1.8.8。我们使用GAE提供的Django 1.2。

我的代码是:

import sys
import os
import datetime
from google.appengine.ext import db
from google.appengine.tools import bulkloader

module_dir = os.path.dirname(os.path.realpath('./data/models.py'))
sys.path.insert(0, module_dir)
import models

class SomeObjectLoader(bulkloader.Loader):
    def __init__(self):
        bulkloader.Loader.__init__(self, 'SomeObject',
                                   [('product_name', lambda x: x.decode('utf-8')),
                                    ('project_id', lambda x: x.decode('utf-8')),
                                    ('asset', lambda x: x.decode('utf-8')),
                                    ('document_id', lambda x: x.decode('utf-8')),
                                    ('content_type', lambda x: x.decode('utf-8')),
                                    ('document_name', lambda x: x.decode('utf-8'))
                                    ])
loaders = [FinalAuditDataLoader]

模型加载正常但是对BaseModel的持续引用我得到了:

追踪(最近一次通话):   文件“/usr/local/bin/appcfg.py”,第196行,in     run_file( file ,globals())   在run_file中输入文件“/usr/local/bin/appcfg.py”,第192行     execfile(script_path,globals_)   提交“/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py”,第4810行,     主(sys.argv中)   文件“/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py”,第4801行,主要内容     result = AppCfgApp(argv).Run()   在运行中输入文件“/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py”,第2611行     self.action(个体经营)   在致电中输入文件“/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py”,第4495行     返回方法()   在PerformDownload中输入文件“/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py”,第4286行     run_fn(参数)   在RunBulkloader中输入文件“/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py”,第4198行     sys.exit(bulkloader.Run(arg_dict))   在运行中输入文件“/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/bulkloader.py”,第4408行     return _PerformBulkload(arg_dict)   在_PerformBulkload中输入文件“/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/bulkloader.py”,第4219行     LoadConfig(CONFIG_FILE)   在LoadConfig中输入文件“/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/bulkloader.py”,第3879行     ('','r',imp.PY_SOURCE))   文件“loader.py”,第9行,in     进口车型   文件“/Users/tim/work/lqe-tool/lqe_data/models.py”,第13行,in     来自appengine_django.models导入BaseModel ImportError:没有名为appengine_django.models

的模块

1 个答案:

答案 0 :(得分:1)

事实证明,代码库有一个appengine_django.zip,这就是appengine_django。*所在的地方..