(self, catchall_backend_id, backend_map)
catchall_backend_id - the pk of the backend that is the default if
                              no prefixes match (can be None if there is no
                              catch all)
        backend_map - a dictionary of {prefix: backend pk} which
                      maps a phone prefix to the backend which should be
                      used for that phone prefix
catchall_backend_id - the pk of the backend that is the default if
                              no prefixes match (can be None if there is no
                              catch all)
        backend_map - a dictionary of {prefix: backend pk} which
                      maps a phone prefix to the backend which should be
                      used for that phone prefix
catchall_backend_id - the pk of the backend that is the default if no prefixes match ( can be None if there is no catch all ) backend_map - a dictionary of { prefix : backend pk } which maps a phone prefix to the backend which should be used for that phone prefix
def __init__(self, catchall_backend_id, backend_map):
        """
        catchall_backend_id - the pk of the backend that is the default if
                              no prefixes match (can be None if there is no
                              catch all)
        backend_map - a dictionary of {prefix: backend pk} which
                      maps a phone prefix to the backend which should be
                      used for that phone prefix
        """
        self.catchall_backend_id = catchall_backend_id
        self.backend_map_dict = backend_map
        self.backend_map_tuples = list(backend_map.items())
        # Sort by length of prefix descending
        self.backend_map_tuples.sort(key=lambda x: len(x[0]), reverse=True)
def __init__ ( self , catchall_backend_id , backend_map ) : self . catchall_backend_id = catchall_backend_id self . backend_map_dict = backend_map self . backend_map_tuples = list ( backend_map . items ( ) ) # Sort by length of prefix descending self . backend_map_tuples . sort ( key = lambda x : len ( x [ 0 ] ) , reverse = True )