INTERSECT Query in DB-API
|Reported by:||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||master|
|Severity:||Keywords:||db api intersect|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
In my example, I have a model called Event. I have a search box and want to search against 3 fields of the model: title, tags and text. When the user types "keg" in the box, all events that have "keg" in their title OR tags OR text will be displayed. If the user types "keg" and "ger" in the box, then all events that both have "keg" and "ger" in their title OR tags OR text will be displayed.
As a result, the queries must be intersected to do achieve this. It would be nice if we could have a intersect() function in the DB-API.