@classmethod<EOL><INDENT>def subscribe(cls, signal_name, weak=True):<DEDENT>
try:<EOL><INDENT>signal = getattr(signals, signal_name)<EOL><DEDENT>except AttributeError:<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'.format(signal_name)<EOL>)<EOL><DEDENT>sender = None if cls._is_root else cls<EOL>return signal.connect_via(sender, weak)<EOL>
:param str signal_name: Name of signal to subscribe to; must be found
    in ``signals.py``.
:param bool weak: Create weak reference to callback
:returns: Decorator created by ``Signal::connect_via``
:raises: ValueError if signal is not found

Example usage: ::

    >>> @Schema.subscribe('before_save')
    ... def listener(cls, instance):
    ...     instance.value += 1