def recent_answers(request): activities = None watching_helper = WatchingHelper() planet_helper = PlanetHelper() activities = watching_helper.recent_answers(request.user) if activities: activities = planet_helper.paginate_activities(request, activities) data = {"activities": activities} return render_to_response(templates["RECENT_ANSWERS"], data, context_instance=RequestContext(request))
def recent_answers(request): activities = None watching_helper = WatchingHelper() planet_helper = PlanetHelper() activities = watching_helper.recent_answers(request.user) if activities: activities = planet_helper.paginate_activities(request, activities) data = { 'activities':activities, } return render_to_response( templates['RECENT_ANSWERS'], data, context_instance=RequestContext(request))
def planeta_rss(request, kind=None): activities = None planet_helper = PlanetHelper(ITEMS_PER_FEED) if kind == "all": activities = planet_helper.planet_all() elif kind == "followers": followers_list = planet_helper.get_followers_list(request.user) activities = planet_helper.planet_followers(followers_list) elif kind == "similar_users": similar_users_list = planet_helper.get_similar_users_list(request) activities = planet_helper.planet_similar_users(similar_users_list) elif kind == "short_reviews": activities = planet_helper.planet_short_reviews() elif kind == "notes": activities = planet_helper.planet_notes() elif kind == "comments": activities = planet_helper.planet_comments() elif kind == "most_interesting": activities = planet_helper.planet_most_interesting() elif kind == "links": activities = planet_helper.planet_links() response = HttpResponse(mimetype='application/rss+xml') t = loader.get_template(templates['PLANET_RSS']) c = Context({'activities': activities,'kind': kind}) response.write(t.render(c)) return response
def planeta_rss(request, kind=None): activities = None planet_helper = PlanetHelper(ITEMS_PER_FEED) if kind == "all": activities = planet_helper.planet_all() elif kind == "followers": followers_list = planet_helper.get_followers_list(request.user) activities = planet_helper.planet_followers(followers_list) elif kind == "similar_users": similar_users_list = planet_helper.get_similar_users_list(request) activities = planet_helper.planet_similar_users(similar_users_list) elif kind == "short_reviews": activities = planet_helper.planet_short_reviews() elif kind == "notes": activities = planet_helper.planet_notes() elif kind == "comments": activities = planet_helper.planet_comments() elif kind == "most_interesting": activities = planet_helper.planet_most_interesting() elif kind == "links": activities = planet_helper.planet_links() response = HttpResponse(mimetype='application/rss+xml') t = loader.get_template(templates['PLANET_RSS']) c = Context({'activities': activities, 'kind': kind}) response.write(t.render(c)) return response