> For a case like this they probably result in roughly the same (if not
> identical) SQL.  In general it's better to use Q objects since django
> doens't have to piece together 2 seperate cases and then munge them
> together, which can get difficult with complicated aliasing and probably can
> produce suboptimal SQL in those cases.
>
> Alexx
>

That's kind of what i was thinking... Here's what i have:

    pg=WebPage.objects.get(
        Q(body__icontains=delurl) | Q(blurb__icontains=delurl)


in theory that should be identical to "select * from webpage where
body like '%delurl%' or blurb like '%delurl%'"

I have two records.  One has the value i'm looking for in the blurb,
the other in the body, so it should return 2.

I'm getting this traceback:

get() returned more than one WebPage -- it returned 2! Lookup
parameters were {}


--~--~---------~--~----~------------~-------~--~----~
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