Not a problem, Eric, glad to be of help.

You could also do this:

ContentType.objects.filter(app_label__exact='aiyo',
model__in=('content', 'product'))

which is more concise and may treat the query optimizer in your database
better.

Regards,
-scott


On Sat, 2006-06-24 at 17:00 +0000, nkeric wrote:
> >>> ContentType.objects.filter((Q(app_label__exact='aiyo') & 
> >>> Q(model__exact='content')) | (Q(app_label__exact='aiyo') & 
> >>> Q(model__exact='product')))
> [<ContentType: Content>, <ContentType: Product>]
> >>> c.queries [{'time': '0.000', 'sql': 'SELECT 
> >>> "django_content_type"."id","django_content_type"."name","django_content_type"."app_label","django_content_type"."model"
> >>>  FROM "django_content_type" WHERE ((("django_content_type"."app_label" = 
> >>> aiyo AND "django_content_type"."model" = content) OR 
> >>> ("django_content_type"."app_label" = aiyo AND 
> >>> "django_content_type"."model" = product))) ORDER BY 
> >>> "django_content_type"."name" ASC'}]
> >>>
> 
> wow! that works, perfect! big thanks to Scott, you've been a great
> help!
> 
> Regards,
> 
> - eric
> 
> 
> > 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to