Drastically simplifying SQL command to find existing stories. Removed all found GUIDs and am just using the start/end dates in the feed.

This commit is contained in:
Samuel Clay 2010-08-19 22:43:49 -04:00
parent 03fc6aa2ad
commit d6dfc25e4e

View file

@ -176,8 +176,8 @@ class ProcessFeed:
end_date = story.get('published')
story_guids.append(story.get('guid') or story.get('link'))
existing_stories = Story.objects.filter(
(Q(story_date__gte=start_date) & Q(story_date__lte=end_date))
| (Q(story_guid__in=story_guids)),
story_date__gte=start_date,
story_date__lte=end_date,
story_feed=self.feed
).order_by('-story_date')
ret_values = self.feed.add_update_stories(self.fpf.entries, existing_stories)