def get_function_from_string(string):
    """
    Return function from given dotted string. It imports correct module
    and than gets needed functon.
    """
    modulename, function_name = string.rsplit('.', 1)
    m = __import__(modulename, globals(), locals(), [function_name])
    return getattr(m, function_name)
