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 django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment