2010-06-05 78 views
0

我開發服務器上運行谷歌應用程序引擎模型。谷歌應用程序引擎:類型錯誤問題

這裏是我的模型文件:

from google.appengine.ext import db 

import pickle 
import re 

re_dept_code = re.compile(r'[A-Z]{2,}') 
re_course_number = re.compile(r'[0-9]{4}') 

class DependencyArcHead(db.Model): 
    sink = db.ReferenceProperty() 
    tails = db.ListProperty() 

class DependencyArcTail(db.Model): 
    courses = db.ListProperty() 

它給這個錯誤:

Traceback (most recent call last): 
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3192, in _HandleRequest 
    self._Dispatch(dispatcher, self.rfile, outfile, env_dict) 
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 3135, in _Dispatch 
    base_env_dict=env_dict) 
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 516, in Dispatch 
    base_env_dict=base_env_dict) 
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2394, in Dispatch 
    self._module_dict) 
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2304, in ExecuteCGI 
    reset_modules = exec_script(handler_path, cgi_path, hook) 
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2200, in ExecuteOrImportScript 
    exec module_code in script_module.__dict__ 
    File "main.py", line 19, in <module> 
    from src.Models import Course, findCourse, validateCourse, dictForJSON, clearAndBuildDependencyGraph 
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1279, in Decorate 
    return func(self, *args, **kwargs) 
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1929, in load_module 
    return self.FindAndLoadModule(submodule, fullname, search_path) 
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1279, in Decorate 
    return func(self, *args, **kwargs) 
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1831, in FindAndLoadModule 
    description) 
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1279, in Decorate 
    return func(self, *args, **kwargs) 
    File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1782, in LoadModuleRestricted 
    description) 
    File "src\Models.py", line 14, in <module> 
    class DependencyArcHead(db.Model): 
    File "src\Models.py", line 17, in DependencyArcHead 
    tails = db.ListProperty() 
TypeError: __init__() takes at least 2 arguments (1 given) 

我在做什麼錯?

回答

2

可能的解決辦法:我是缺少在listProperty()構造函數中的參數type_name。哎呀。

相關問題