感谢您花时间看我的问题!我正在尝试在 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.")