QuerySet.__or__ has bad behavior in the presence of extra
|Reported by:||Alex Gaynor||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||master|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
If you do something like
q = Model.objects.extra(where=["some stuff"]) | Model.objects.filter(c=d)
In this csae the where clause of the 2nd queryset gets lost because of the way they are combined. This is a symptom of the fact that extra where stuff is basically tacked onto the end of a queryset after the fact.