pagelist=[]

    pg=WebPage.objects.filter(body__icontains=delurl)
    if pg.count()>0:
        for id in pg:
            pagelist.append(id.url_slug)

    pg2=WebPage.objects.filter(blurb__icontains=delurl)
    if pg2.count()>0:
        for id in pg2:
            pagelist.append(id.url_slug)


What is the proper way to chain filters?  This is the only way I can
get it work where the body OR the blurb contains delurl.  If i try to
do this:

    pagelist=[]

    pg=WebPage.objects.filter
(body__icontains=delurl,blurb__icontains=delurl)
    if pg.count()>0:
        for id in pg:
            pagelist.append(id.url_slug)

that results in an AND comparison and doesn't return any values.
--~--~---------~--~----~------------~-------~--~----~
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