def render(self, context): pop_articles = cache.get_pop_articles() recent_articles = cache.get_recent_articles() template_search_list = [ "core/article_sidebar.html", ] liststr = render_to_string(template_search_list, { "pop_articles": pop_articles, 'recent_articles': recent_articles, }, context) return liststr
def render(self, context): value = context[self.type] if value == '2': pop_articles = cache.get_pop_tips() else: pop_articles = cache.get_pop_articles() template_search_list = [ "core/article_slider.html", ] liststr = render_to_string(template_search_list, { "pop_articles": pop_articles }, context) return liststr