Something that has been bothering me for awhile and I finally just
decided to post it here because my code work around hits the database
way too many times.

I am writing a custom view for an application that uses multiple
categories per story. So I want to lookup stories so that they aren't
duplicates and they don't appear in a category that is displayed
before. So

breakingnews =
Story.objects.all.filter(category__name__exact="breakingnews")
news = Story.Objects.all.exclude(ids = breakingnews.ids)

Now I realize that I could just exclude the filter, so:
news = Story.Objects.all.exclude(category__name__exact="breakingnews")

but this gets really long once I start factoring time and uniqueness.
Is there an easy way to filter objs like that?

Thanks in advance, Mn


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to