On Tue, May 26, 2009 at 2:17 PM, Pavel <pv...@wp.pl> wrote:

>
> Hi everybody!
>
> I've got a newby question according django QuerySet API.
> I know that a statement:
> Entry.objects.filter(pub_date__gt=datetime.date(2005, 1, 3),
> headline='Hello')
> is equivalent to SQL query:
> SELECT ...
> WHERE  (pub_date > '2005-1-3' AND headline = 'Hello')
>
> My question is how to enforce django to execute followinq query:
> SELECT ...
> WHERE  (pub_date > '2005-1-3' OR headline = 'Hello')
>
> Thank you in advance,
> Pavel
> >
>
Take a look at Q objects:
http://docs.djangoproject.com/en/dev/topics/db/queries/#complex-lookups-with-q-objectsas
described there.

Alex

-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." --Voltaire
"The people's good is the highest law."--Cicero

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to