def feed_for_user(request): """ An atom feed for all unarchived :model:`notification.Notice`s for a user. """ url = "feed/%s" % request.user.username return Feed(request, url, { "feed": NoticeUserFeed, })
def feed_for_user(request): """ An atom feed for all unarchived :model:`notification.Notice`s for a user. """ url = reverse("notification:notification_feed_for_user", kwargs={'username': request.user.username}) return Feed(request, url, { "feed": NoticeUserFeed, })
def feed_for_user(request): """ An atom feed for all unarchived :model:`notification.Notice`s for a user. """ url = "feed/%s" % request.user.username return Feed(request, url, { # Exhanged feed by Feed. Does it actually work? "feed": NoticeUserFeed, })
def feeds(request, blog_slug, feed_item, **kwargs): from django.contrib.syndication.views import Feed if '/' in feed_item: feed_type, slug = feed_item.split('/', 1) else: feed_type = feed_item slug="" if 'blog_root' in kwargs: del kwargs['blog_root'] if feed_type == "posts": return Feed(request, url="posts/%s"% ( blog_slug ), **kwargs) elif feed_type == "tag": return Feed(request, url="tag/%s/%s"% ( blog_slug, feed_item ), **kwargs) raise Http404
def __call__(self, request, *args, **kwargs): key = self.get_cache_key(*args, **kwargs) reply = cache.get(key) if reply is None: reply = Feed.__call__(self, request, *args, **kwargs) cache.set(key, reply, 100500) # About 28 hours :] if settings.DEBUG: print "Cache %s miss!" % (key) else: if settings.DEBUG: print "Cache %s hit!" % (key) return reply
def __init__(self): Feed.__init__(self) self.all_items = [] # all items for this rss feed self.feed_for_item = {} # item -> feed cache self.load_feeds_items() # load items
def get_feed(self, *args, **kwargs): feed = Feed.get_feed(self, *args, **kwargs) # Force the language in the feed to be correct (bad design django Feed!) feed.feed['language'] = to_unicode(get_language()) return feed
def __init__(self): Feed.__init__(self) self.feed_for_item = {}
def feed_for_user(request): url = "feed/%s" % request.user.username return Feed(request, url, { "feed": NoticeUserFeed, })
def __init__(self, *args, **kw): Feed.__init__(self, *args, **kw) self.request = None