Re: db API where ...or...

2008-12-15 Thread Lars Stavholm
Thanks Tim, works like a charm. /L Tim Chase wrote: >> when combining Django ORM criteria you get >> the "...WHERE...AND..." clauses. >> >> How do I get the "...WHERE...OR..." clauses? >> >> Resorting to raw SQL? > > > Use Q objects and OR them together: > > http://www.djangoproject.com/docume

Re: db API where ...or...

2008-12-15 Thread Lars Stavholm
Alex Koshelev wrote: > http://docs.djangoproject.com/en/dev/topics/db/queries/#complex-lookups-with-q-objects That's the one I'm looking for. Thanks! /L > On Mon, Dec 15, 2008 at 18:35, Lars Stavholm > wrote: > > > Hi all, > > when combining Django ORM crite

Re: db API where ...or...

2008-12-15 Thread Tim Chase
> when combining Django ORM criteria you get > the "...WHERE...AND..." clauses. > > How do I get the "...WHERE...OR..." clauses? > > Resorting to raw SQL? Use Q objects and OR them together: http://www.djangoproject.com/documentation/models/or_lookups/ Foo.objects.filter( Q(field1='baz')

Re: db API where ...or...

2008-12-15 Thread Alex Koshelev
http://docs.djangoproject.com/en/dev/topics/db/queries/#complex-lookups-with-q-objects On Mon, Dec 15, 2008 at 18:35, Lars Stavholm wrote: > > Hi all, > > when combining Django ORM criteria you get > the "...WHERE...AND..." clauses. > > How do I get the "...WHERE...OR..." clauses? > > Resorting

db API where ...or...

2008-12-15 Thread Lars Stavholm
Hi all, when combining Django ORM criteria you get the "...WHERE...AND..." clauses. How do I get the "...WHERE...OR..." clauses? Resorting to raw SQL? Kinda' lost, any input appreciated /Lars --~--~-~--~~~---~--~~ You received this message because you are subs