def METHOD_NAME(self, view_class):
    protocol = view_class.PROTOCOL
    if protocol in self.BY_PROTOCOL:
        raise ValueError("Duplicate index view for protocol: %s" % protocol)
    self.BY_PROTOCOL[protocol] = view_class