def get_func_from_callback(method, callback):
    """
    Get function from callback
    :param callback: endpoint's callback (urlpattern's callback)
    :param method: get, post, ...
    :return: function
    """
    cls = getattr(callback, 'cls', None)
    actions = getattr(callback, 'actions', None)
    if cls is None:
        return None
    if actions is None:
        if callable(cls):
            return getattr(cls(), method.lower(), None)
    view_name = actions.get(method.lower(), None)
    if view_name is None:
        return None
    return getattr(cls, view_name, None)
