def should_register(self, app):
        """
        Determines whether or not this route should be registered with the app,
        based on :attr:`only_if`.
        """
        if self.only_if is None:
            return True
        elif callable(self.only_if):
            return self.only_if(app)
        return bool(self.only_if)
Determines whether or not this route should be registered with the app,
        based on :attr:`only_if`.