1

appengine-rest-server(1.0.6)をダウンロードして、このモジュールをアプリケーションで使用しようとしましたが、エラーが発生します。誰かがPython2.7.2で実用的な例を持っていますか?

モジュールを初期化するための私のコードに従って:

rest.Dispatcher.base_url = '/rest'
rest.Dispatcher.add_models({
  "customer": customer.customer,
  "place": customer.place})
application = webapp.WSGIApplication([<Some other Routs> ,
                                  ('/rest/.*', rest.Dispatcher)], debug=True)

このエラーが発生します:

File "\src\rest\__init__.py", line 1551, in initialize
  request.disp_query_params_ = None
AttributeError: 'NoneType' object has no attribute 'disp_query_params_'

多分それは私のせいですか?

4

1 に答える 1

0

次の関数を変更すると、動作するようです。

  def initialize(self, request, response):
        if request != None and response != None: 
            super(Dispatcher, self).initialize(request, response)
            request.disp_query_params_ = None
            response.disp_cache_resp_ = True
            response.disp_out_type_ = TEXT_CONTENT_TYPE
于 2012-07-31T10:02:49.310 に答える