def get_queryset(self):  # type: ignore[no-untyped-def]
        """
        Override queryset to filter based on the parent identity.
        """
        if getattr(self, "swagger_fake_view", False):
            return Trait.objects.none()

        return Trait.objects.filter(identity=self.identity)

        Override queryset to filter based on the parent identity.
        
api/environments/identities/traits/views.py