Я всегда получаю эту ошибку TypeError: not all arguments converted during string formatting
Вот мой запрос
State.objects.raw('...review_create_date between %s and %s group by error_type',[fromdate,todate])
Здесь fromdate=2011-05-21
и todate='2011-05-27'
Приведенный выше запрос выполняется в приглашении mysql, но не может работать в оболочке python
Пожалуйста, кто-нибудь, помогите мне
Вот трассировка
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 1412, in __iter__
query = iter(self.query)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/query.py", line 73, in __iter__
self._execute_query()
File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/query.py", line 87, in _execute_query
self.cursor.execute(self.sql, self.params)
File "/usr/local/lib/python2.6/dist-packages/django/db/backends/util.py", line 18, in execute
sql = self.db.ops.last_executed_query(self.cursor, sql, params)
File "/usr/local/lib/python2.6/dist-packages/django/db/backends/__init__.py", line 216, in last_executed_query
return smart_unicode(sql) % u_params
TypeError: not all arguments converted during string formatting