Re: Quoting in extra(select=...) expression

2009-05-11 Thread Malcolm Tredinnick
On Mon, 2009-05-11 at 12:09 -0700, lemming110 wrote: [...] > But using extra(select={'comment_count': sql,}) where > > sql = '''select count(*) > from django_comments > where django_comments.content_type_id=12 and > django_comments.object_pk= > %s''' > > gives me an error every way that I have t

Re: Quoting in extra(select=...) expression

2009-05-11 Thread Matthias Kestenholz
Hey, On Mon, May 11, 2009 at 9:09 PM, lemming110 wrote: > > I am trying to use the select keyword in extra.  But I cannot properly > quote the the expression for postrgres.  I am using the > django.contrib.comments.  I started with this snippet > http://www.djangosnippets.org/snippets/1101/ whic

Quoting in extra(select=...) expression

2009-05-11 Thread lemming110
I am trying to use the select keyword in extra. But I cannot properly quote the the expression for postrgres. I am using the django.contrib.comments. I started with this snippet http://www.djangosnippets.org/snippets/1101/ which returns the number of comments for an object. However, the code d