File diff 387275c9d4b4 → 835d482604b3
www/conservancy/feeds.py
Show inline comments
...
 
@@ -151,15 +151,12 @@ class OmnibusFeed(ConservancyFeedBase):
 

	
 
class BlogFeed(ConservancyFeedBase):
 
    link = "/blog/"
 
    get_absolute_url = '/feeds/blog/'
 

	
 
    def get_object(self, request):
 
        # This is a hack:  keep GET object handy so I always have it in all methods.
 
        if not hasattr(self, 'GET') and request and hasattr(request, 'GET'):
 
            self.GET = request.GET
 
        return request
 

	
 
    def title(self, obj):
 
        answer = "The Software Freedom Conservancy Blog"
 

	
 
        GET = obj.GET
...
 
@@ -223,35 +220,19 @@ class BlogFeed(ConservancyFeedBase):
 
        return item.summary
 

	
 
    def item_author_name(self, item):
 
        return item.author.formal_name
 

	
 
    def item_author_email(self, item):
 
        GET = self.GET
 
        if not 'author' in GET:
 
            return "%s@sfconservancy.org" % item.author
 
        else:
 
            answer = ""
 
            authors = GET.getlist('author')
 
            firstTime = True
 
            for author in authors:
 
                if not firstTime:
 
                    answer = "%s@sfconservancy.org" % author
 
                    firstTime = False
 
                else:
 
                    answer += ",%s@sfconservancy.org" % author
 
        return "%s@sfconservancy.org" % item.author
 

	
 
    def item_pubdate(self, item):
 
        return item.pub_date
 

	
 
    def items(self, obj):
 
        # This is a hack:  keep GET object handy so I always have it in all methods.
 
        if not hasattr(self, 'GET') and request and hasattr(request, 'GET'):
 
            self.GET = request.GET
 

	
 
        GET = self.GET
 
        GET = obj.GET
 

	
 
        def OR_filter(field_name, subfield_name, objs):
 
            from django.db.models import Q
 
            return reduce(lambda x, y: x | y,
 
                          [Q(**{'%s__%s' % (field_name, subfield_name): x})
 
                           for x in objs])