def render(self, context):
        try:
            num = self.num.resolve(context)
            topic = self.topic.resolve(context) if self.topic else None
        except template.VariableDoesNotExist:
            return ''
        
        if isinstance(topic, Topic):
            qs = Question.objects.filter(topic=topic)
        elif topic is not None:
            qs = Question.objects.filter(topic__slug=topic)
        else:
            qs = Question.objects.all()
            
        context[self.varname] = qs.filter(status=Question.ACTIVE)[:num]
        return ''
dataset/ETHPy150Open howiworkdaily/django-faq/faq/templatetags/faqtags.py/FaqListNode.render/original