On 4-Oct-06, at 6:12 PM, Andy Dustman wrote:

> I'm not sure this will fix your problem, but it might from my reading
> of the code. Try reversing the order of the filter() and extra()
> methods, i.e.
>
> qs = Place.objects.all().extra(select={'relevance': match_expr},
> params=[query]).filter(name__search=query)

That doesn't seem to fix it for me. The problem seems to be that the  
code strips all of the column names when it does the SELECT COUNT(*),  
but doesn't strip the parameters from the list it passes to execute 
(). It breaks even without any other filters.

A simpler example might be something like:

 >>> qs = Place.objects.all().extra(select={'hello': '%s'}, params= 
['world',])
 >>> qs.count()
Traceback (most recent call last):
   File "<console>", line 1, in ?
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/Django-0.95-py2.4.egg/django/db/models/ 
query.py", line 202, in count
     cursor.execute("SELECT COUNT(*)" + sql, params)
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/Django-0.95-py2.4.egg/django/db/backends/ 
util.py", line 19, in execute
     self.db.queries.append({
TypeError: not all arguments converted during string formatting

Thanks!
Beau

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to