Re: what is django.db.models.Q for?

2012-01-27 Thread snow leung
thanks ,helpful On 1月11日, 上午10时38分, Eugene Wee wrote: > Hi, > > On Wed, Jan 11, 2012 at 10:27 AM, Yekui Wen wrote: > > can you guys tell me what is the Q method for ? > > Yes, though they are Q objects, not methods. Refer >

Re: what is django.db.models.Q for?

2012-01-10 Thread Wen 温业逵Yekui
thanks! 2012/1/11 Eugene Wee > Hi, > > On Wed, Jan 11, 2012 at 10:27 AM, Yekui Wen wrote: > > can you guys tell me what is the Q method for ? > > Yes, though they are Q objects, not methods. Refer to: > >

Re: what is django.db.models.Q for?

2012-01-10 Thread Eugene Wee
Hi, On Wed, Jan 11, 2012 at 10:27 AM, Yekui Wen wrote: > can you guys tell me what is the Q method for ? Yes, though they are Q objects, not methods. Refer to: https://docs.djangoproject.com/en/1.3/topics/db/queries/#complex-lookups-with-q-objects Regards, Eugene -- You

what is django.db.models.Q for?

2012-01-10 Thread Yekui Wen
hey guys, I need your help can you guys tell me what is the Q method for ? -- 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

Re: django.db.models.Q

2008-11-09 Thread Alex Koshelev
http://docs.djangoproject.com/en/dev/topics/settings/#designating-the-settings On Mon, Nov 10, 2008 at 07:13, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > > >>> from django.db.models import Q > > Traceback (most recent call last): > File "", line 1, in > File

django.db.models.Q

2008-11-09 Thread [EMAIL PROTECTED]
>>> from django.db.models import Q Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.5/site-packages/django/db/__init__.py", line 9, in if not settings.DATABASE_ENGINE: File "/usr/lib/python2.5/site-packages/django/conf/__init__.py", line 28, in

Re: django.db.models.Q for OR lookup is having issues with NULL values

2008-01-02 Thread Malcolm Tredinnick
On Wed, 2008-01-02 at 14:25 -0800, Peter wrote: > I am trying to filter by users who are not staff, but this user column > accepts NULL values in my model. > > As a result I need to check for user__isnull, since > user__is_staff=False will not work for null values. > > I tried: >

django.db.models.Q for OR lookup is having issues with NULL values

2008-01-02 Thread Peter
I am trying to filter by users who are not staff, but this user column accepts NULL values in my model. As a result I need to check for user__isnull, since user__is_staff=False will not work for null values. I tried: Post.objects.filter(Q(user__isnull=True) | Q(user__is_staff=False)) but this