def _html_feeds(last_feed, user, csrf_token, feed_source='all'): feeds = Feed.get_feeds_after(last_feed,user) if feed_source != 'all': feeds = feeds.filter(user__id=feed_source) html = u'' for feed in feeds: html = u'{0}{1}'.format(html, render_to_string('feeds/partial_feed.html', { 'feed': feed, 'user': user, 'csrf_token': csrf_token }) ) return html
def check(request): last_feed = request.GET.get('last_feed') feed_source = request.GET.get('feed_source') feeds = Feed.get_feeds_after(last_feed,request.user) print feeds if feed_source != 'all': feeds = feeds.filter(user__id=feed_source) if feeds == []: count=0 else: print feeds print len(feeds) count = len(feeds) return HttpResponse(count)