Thank you, I have upgraded to 0.9.5 now.
Still can't get it to work, though. What does "self" refer to in
"other_qs = QuerySet(self.model)" ?
I changed it to Document, my class that represents an article:

def search(request):

        query = request.POST['query']
        or_query=Q()
        search_fields = ['title', 'body']

        if query:
                for bit in query.split():
                        or_queries = [Q(**{'%s__icontains' % field_name: bit}) 
for
field_name in search_fields]
                        other_qs = QuerySet(Document)
                        other_qs = other_qs.filter(reduce(operator.or_, 
or_queries))
        return other_qs

This gives me the following traceback:

Traceback (most recent call last):

  File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/core/servers/basehttp.py",
line 272, in run
    self.result = application(self.environ, self.start_response)

  File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/core/servers/basehttp.py",
line 615, in __call__
    return self.application(environ, start_response)

  File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/core/handlers/wsgi.py",
line 150, in __call__
    response = middleware_method(request, response)

  File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/contrib/sessions/middleware.py",
line 74, in process_response
    patch_vary_headers(response, ('Cookie',))

  File
"/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/utils/cache.py",
line 104, in patch_vary_headers
    if response.has_header('Vary'):

AttributeError: 'QuerySet' object has no attribute 'has_header'

Any suggestions?
Thanks,
Kristoffer


--~--~---------~--~----~------------~-------~--~----~
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