Search - User list
Full Version: Unable to search with latest version of DjangoBB
Root » Bugs » Unable to search with latest version of DjangoBB
1
mdsol
Hi everybody.

Everytime I try to do a search, I receive the following error:

TypeError at /search/
unsupported operand type(s) for |=: 'list' and 'SQ'

I have the following env:

(env)Angus:forum francesco$ pip freeze
Django==1.2.5
Markdown==2.0
MySQL-python==1.2.3
PIL==1.1.7
Pygments==1.4
South==0.7.3
Whoosh==1.8.4
-e hg+[url]http://bitbucket.org/benoitc/django-authopenid@2bf32e03f71cb98de98b1bf1e4689c88837583b4#egg=django_authopenid-tip[/url]
django-debug-toolbar==0.8.5
django-haystack==1.2.4
-e git://github.com/jtauber/django-mailer.git@840d25bb9db9fbc801b9226607ddce49f4ac37c5#egg=django_mailer-0.2a1.dev3-py2.6-dev
django-messages==0.4.4
django-registration==0.7
-e svn+[url]http://postmarkup.googlecode.com/svn/trunk@74#egg=postmarkup-1.1.5dev-py2.6-dev_r74[/url]
python-openid==2.2.5
wsgiref==0.1.2

and djangobb-forum downloaded 2 days ago.

Is this a known bug? I have tryed to search something but haven't found anything useful.
I have also trield to use the “simple” search engine, with some different errors.

Thank you,
Francesco
slav0nic
known, i f u have time - send patch )
mdsol
I am working on it, but I cannot figure how to fix it.
Is there any known combination of haystack/whoosh that is known to be working?
mdsol
I have fixed it.
The search is very slow, but it works.
How can I send you the patch? Attaching here the new views.py?
slav0nic
create ticket or find opened at djangobb.org

slow? what u mean) i don't think tnat haystack very slow solution for searching if u path correct.
testjoey
the fix is very easy. you just need to change line 196 of views.py from

topics_to_exclude |= SQ(topic=post.object.topic)

to

topics_to_exclude = topics_to_exclude | SQ(topic=post.object.topic)

and change line 190 of views.py from

topics_to_exclude = []

to

topics_to_exclude = SQ()

you then have to fix search_posts.html to use posts.object instead of posts.instance for when you search by posts. (there is another thread about this)
slav0nic
testjoey
tnx, commited)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB