使用 django-tastypie-mongoengine
相同的配置在本地服务器/ Windows 服务器上运行良好。在linux服务器上,出现以下错误:
{"error_message": "'QuerySet' object has no attribute '_reset_already_indexed'", "traceback": "Traceback (most recent call last):\n\n File \"/usr/local/lib/python2.7/site-packages/tastypie/resources.py\", line 217, in wrapper\n response = callback(request, *args, **kwargs)\n\n File \"/usr/local/lib/python2.7/site-packages/tastypie/resources.py\", line 459, in dispatch_list\n return self.dispatch('list', request, **kwargs)\n\n File \"/usr/local/lib/python2.7/site-packages/tastypie_mongoengine/resources.py\", line 373, in dispatch\n return super(MongoEngineResource, self).dispatch(request_type, request, **kwargs)\n\n File \"/usr/local/lib/python2.7/site-packages/tastypie/resources.py\", line 491, in dispatch\n response = method(request, **kwargs)\n\n File \"/usr/local/lib/python2.7/site-packages/tastypie/resources.py\", line 1299, in get_list\n objects = self.obj_get_list(bundle=base_bundle, **self.remove_api_resource_names(kwargs))\n\n File \"/usr/local/lib/python2.7/site-packages/tastypie/resources.py\", line 2112, in obj_get_list\n objects = self.apply_filters(bundle.request, applicable_filters)\n\n File \"/usr/local/lib/python2.7/site-packages/tastypie/resources.py\", line 2084, in apply_filters\n return self.get_object_list(request).filter(**applicable_filters)\n\n File \"/usr/local/lib/python2.7/site-packages/tastypie_mongoengine/resources.py\", line 309, in get_object_list\n self._reset_collection()\n\n File \"/usr/local/lib/python2.7/site-packages/tastypie_mongoengine/resources.py\", line 301, in _reset_collection\n self._meta.queryset._reset_already_indexed()\n\nAttributeError: 'QuerySet' object has no attribute '_reset_already_indexed'\n"}
请帮忙!!