Weblog

"OR" query support

We've added "OR" query support to the Django database API, in the Django development version.

It supported OR queries previously, but it wasn't documented because it wasn't elegant enough. We're happy with the new solution, which was discussed by a bunch of people and implemented by Hugo. Thanks, Hugo!

Read all about it here.

Posted by Adrian Holovaty on November 30, 2005

Comments

Maniac December 1, 2005 at 4:17 a.m.

Honestly I think this has come to a state where raw SQL looks clearer :-)).

But yes, consistency in API is more important.

laaa December 1, 2005 at 4:19 a.m.

Great!

Lee Phillips December 1, 2005 at 1:36 p.m.

I've used this for AND queries too: I wanted to do an AND conjunction of several "contains" queries on the same field, but got an error that I was repeating a keyword argument. There might be another way to do this, but the new "OR" query support (really the "complex" lookup type) solves this problem.

Comments are closed

To prevent spam, comments are no longer allowed after sixty days.