Example #1
0
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,
    })
Example #2
0
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,
    })
Example #3
0
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,
    })
Example #4
0
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
Example #5
0
    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
Example #6
0
 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
Example #7
0
 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
Example #8
0
 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
Example #9
0
 def __init__(self):
     Feed.__init__(self)
     self.feed_for_item = {}
Example #10
0
 def __init__(self):
     Feed.__init__(self)
     self.feed_for_item = {}
Example #11
0
def feed_for_user(request):
    url = "feed/%s" % request.user.username
    return Feed(request, url, {
        "feed": NoticeUserFeed,
    })
Example #12
0
 def __init__(self, *args, **kw):
     Feed.__init__(self, *args, **kw)
     self.request = None
Example #13
0
 def __init__(self, *args, **kw):
     Feed.__init__(self, *args, **kw)
     self.request = None