Re: Correctly passing parameters to raw query

2014-09-24 Thread James Brewer
Also, it is worth mentioning that the RawQuerySet object looks to have been refactored in the latest development release. I have not verified this issue on the development branch. On Wed, Sep 24, 2014 at 3:53 PM, James Brewer wrote: > This is going to depend on the version of Django you're using

Re: Correctly passing parameters to raw query

2014-09-24 Thread James Brewer
This is going to depend on the version of Django you're using. Accord to the docs for 1.7[1], this should work fine. After playing around in the shell for a bit, I found I was getting an error complaining about arguments not being converted during string formatting. It seems the problem occurs whe

Re: Correctly passing parameters to raw query

2014-09-24 Thread Collin Anderson
Interesting. I don't use raw queries, but I wonder if Django doesn't support lists as parameters to raw() -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django

Correctly passing parameters to raw query

2014-09-24 Thread termopro
Hello, I am constructing raw query which looks like the following: "SELECT * FROM some_table WHERE id IN (1,3,5);" So inside my view i write: entities = Entity.objects.raw(""" SELECT * FROM some_table WHERE id IN (%s); """, [ids_list]) How should i correctly pass the argument ? Because i keep