QuerySet._combine does not combine where clause
|Reported by:||Owned by:||Adrian Holovaty|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
In db/models/query.py, QuerySet, the _combine method does not actually combine the two query sets. Instead if clones the second one and returns that.
- Create a custom manager for an object that uses the admin interface, and has a search box.
- Make that custom manager change the 'where' clause of it's query set, for example by using the 'extra' method to limit the query via a join.
- List the objects in the admin interface. You will see the limited set, which is correct.
- Use the search box on the list admin page. The results now returned are not limited by your manager, because the 'where' clause gets lost.