def render(self, context):
        request = context['request']
        allowed_objects = get_allowed_objects(
            request.user, ArticleCategory, 'reader')
        mao = get_allowed_objects(
                request.user, ArticleCategory, 'manager')

        if self.categories is not None:
            categories = map(int, self.categories.split(','))
            allowed_objects = [ c for c in categories if c in allowed_objects]
        stories = ArticleStory.objects.select_related().filter(
            categories__in=allowed_objects).distinct().order_by('-time_updated')[:int(self.limit)]
        for story in stories:
            story.current_categories = story.categories.all()
            story.current_category = story.current_categories[0]
            story.url = reverse('view_story', args=[story.current_category.pk, story.pk, story.slug])
            intersect = set(mao).intersection( set([category.pk for category in story.current_categories]))
            if intersect:
                story.edit__url = reverse('edit_story', args=[story.pk])
        context[self.var_name] = stories
        return ''
dataset/ETHPy150Open zorna/zorna/zorna/articles/templatetags/articles_tags.py/get_recent_stories_node.render/original