Opened 18 years ago
Closed 18 years ago
#3962 closed (invalid)
sqlite3 backend does not allow '%i' in cursor.execute
Description ¶
In file /usr/lib/python2.4/site-packages/django/db/backends/sqlite3/base.py is sais:
def convert_query(self, query, num_params): return query % tuple("?" * num_params)
This raises a TypeError in cases like: "SELECT * FROM table WHERE id = %i" % tuple("?" * 1), because '?' is no int.
A workaround for this special case could be
return query.replace('%i', '%s') % tuple("?" * num_params)
Note:
See TracTickets
for help on using tickets.
When does this occur? will this only happen when using custom SQL?