AppEngine中的Django 1.2的BaseModel在哪里?

我正在尝试编写一个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引用,我得到:

Traceback(最近的最后一次调用):在run_file( file ,globals())文件“/usr/local/bin/appcfg.py”中,第196行,文件“/usr/local/bin/appcfg.py”,第192行,在run_file execfile(script_path,globals_)文件“/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py”,行4810,在main (sys.argv)文件“/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py”,行4801,main result = AppCfgApp( argv).Run()文件“/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py”,行2611,在Run self.action (self)文件“/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py”,第4495行,在 在PerformDownload run_fn(args)中调用返回方法()文件“/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py”,第4286行。文件“/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py”,第4198行,在RunBulkloader sys.exit(bulkloader.Run(arg_dict ))运行中的文件“/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/bulkloader.py”,行4408,返回_PerformBulkload(arg_dict)File“ /Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/bulkloader.py“,第4219行,位于_PerformBulkload LoadConfig(config_file)文件”/ Applications / GoogleAppEngineLauncher中。应用/内容/资源/ GoogleAppEngin e-default.bundle / Contents / Resources / google_appengine / google / appengine / tools / bulkloader.py“,第3879行,LoadConfig('','r',imp.PY_SOURCE))文件”loader.py“,第9行,导入模型文件“/Users/tim/work/lqe-tool/lqe_data/models.py”,第13行,来自appengine_django.models import BaseModel ImportError:没有名为appengine_django.models的模块


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

链接地址: http://www.djcxy.com/p/88699.html

上一篇: Where is BaseModel in AppEngine for Django 1.2?

下一篇: data fails in Google App Engine SDK 1.8.2