Opened 9 years ago

Closed 6 years ago

#6827 closed (wontfix)

[Feature] Allow contains to work with lists

Reported by: David Cramer Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

A useful feature we had added in Curse's Django was a QUERY_TERM for "containswords". The more thought that I put into it, it would make more sense just to have contains allow for lists.

What this would do:

MyModel.objects.filter(name__contains=('hello', 'there'))

SELECT 1 FROM tbl WHERE (name LIKE '%hello%' AND name LIKE '%there%')

It was a pretty quick and useful feature to help with search.

Change History (4)

comment:1 Changed 9 years ago by David Cramer

Summary: [Featured] Allow contains to work with lists[Feature] Allow contains to work with lists

comment:2 Changed 8 years ago by anonymous

Triage Stage: UnreviewedDesign decision needed

comment:3 Changed 8 years ago by Simon Greenhill

Uh, that was me. Need to work out this login thing.

comment:4 Changed 6 years ago by Yeago

Resolution: wontfix
Status: newclosed

Closing this. There are a lot of other ways to achieve this and to me there's no reason why AND should be the default above OR.

PS: I have david's blessing

Note: See TracTickets for help on using tickets.
Back to Top