I can't figure out if there is a way to escape text for raw SQL queries. I
can't use substitution (I think) because I'm building a query like this:
SELECT foo, bar FROM proj_words WHERE foo IN ("bat", "bug", "snip", "snap")
The list of terms for the IN operator can be quite long... I suppose I could
dynamically generate this:
SELECT foo, bar FROM proj_words WHERE foo IN (%s, %s, %s, %s)
... but I was hoping for the much simpler list comprehension that MySQLdb
would do:
my_list = [connection.escape(x) for x in my_list]
However, I don't see an escape function exposed in Django.
Anybody know a good way to do this?
TIA,
Nick
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.