【发布时间】:2013-06-24 16:34:31
【问题描述】:
感谢您花时间查看我的问题! 我正在尝试在 googleappgine 上的 django 中运行以下原始查询:
models.MyModel.objects.raw(
'select count(1) from myapp_mymodel where %s >= my_column',
[4])
我不断收到错误:
NotImplementedError:不支持游标。
但是,游标似乎是在 djangoappengine 中实现的。
还有其他人遇到过这个问题吗?
追溯:
File "..../django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "..../promotions/views.py", line 562, in task_alert_stats
auto_join_sql, auto_join_params)[0]
File "..../django/db/models/query.py", line 1381, in __getitem__
return list(self)[k]
File "..../django/db/models/query.py", line 1326, in __iter__
query = iter(self.query)
File "..../django/db/models/sql/query.py", line 67, in __iter__
self._execute_query()
File "..../django/db/models/sql/query.py", line 81, in _execute_query
self.cursor.execute(self.sql, self.params)
File "..../django/db/backends/util.py", line 34, in execute
return self.cursor.execute(sql, params)
File "..../djangotoolbox/db/base.py", line 620, in __getattribute__
raise NotImplementedError("Cursors are not supported.")
【问题讨论】:
-
它在
djangotoolbox中给出错误。也许你做错了导入? -
我看到了错误,我得到了 djangotoolbox 的最新副本。我应该做哪个导入?
-
我不知道,我对 djangotoolbox 不熟悉。您能否在执行原始查询的文件中发布您的导入?
-
djangotoolbox 本身在调用游标时会引发未实现的错误。我想我必须找到解决方法。
标签: django google-app-engine djangoappengine