2013-12-19 25 views
0

我想寫一個Exporter類,這樣我就可以將我的本地開發數據存儲提取到一個CSV文件。我使用OS X 10.8.5和GAE SDK 1.8.8。我們使用GAE提供的Django 1.2。Django 1.2 AppEngine中的BaseModel在哪裏?

我的代碼是:

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,在 run_file(文件,全局()) 文件 「/usr/local/bin/appcfg.py」,線路192,在run_file 的execfile(script_path,globals_ ) 文件「/ Applications/GoogleAppEngineL auncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py「,第4810行,在 main(sys.argv) 文件」/ Applications/GoogleAppEngineLauncher。應用/內容/資源/ GoogleAppEngine-default.bundle /內容/資源/ google_appengine /谷歌/ AppEngine上/工具/ appcfg.py 「線路4801,在主 結果= AppCfgApp(ARGV).RUN() 文件」/應用/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py 「行2611,在運行 self.action(個體經營) 文件」/應用/ GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py」,線路4495,在CAL升 返回方法() 文件 「/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/appcfg.py」,線4286,在PerformDownload run_fn(args) 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) File「/ Applications/Google AppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/bulkloader.py「,行4219,位於_PerformBulkload LoadConfig(config_file) 文件」/Applications/GoogleAppEngineLauncher.app /Contents/Resources/GoogleAppEngine-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行,在 from appengine_django.models import BaseModel ImportError:No module named appengine_django.models

+0

http://pycruft.wordpress.com/2010/05/28/django-1-2-on-應用程序引擎/ –

回答

1

事實證明,該代碼庫有一個appengine_django.zip,這是appengine_django。*謊言..