I tried to filter a resultset by a many to many field and failed. Can
it be done? What I tried is shown below. What's wrong?
Thank you
jul
To show that a Restaurant instance named "bella napoli" exists, and
that it has two categories:
In [41]: Restaurant.objects.get(name="bella napoli").category.all()
Out[41]: [<Category: french>, <Category: italian>]
The following works:
In [50]: Restaurant.indexer.search('bella').filter(name="bella napoli")
[0].instance
Out[50]: <Restaurant: bella napoli>
But this does not:
In [54]: category=Category.objects.get(name="italian")
In [55]: Restaurant.indexer.search('chez').filter(category=category)
[0].instance
---------------------------------------------------------------------------
(...)
IndexError: list index out of range
--
You received this message because you are subscribed to the Google Groups "Djapian Users" group.
To post to this group, send email to djapia...@googlegroups.com.
To unsubscribe from this group, send email to djapian-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/djapian-users?hl=en.