def is_active(self):
        """
        Check whether this page and all its ancestors are active
        """

        if not self.pk:
            return False

        # No need to hit DB if page itself is inactive
        if not self.active:
            return False

        pages = self.__class__.objects.active().filter(
            tree_id=self.tree_id, lft__lte=self.lft, rght__gte=self.rght
        )
        return pages.count() > self.level

        Check whether this page and all its ancestors are active
        
feincms/module/page/models.py