def request_value(request, key, default=None):
    """
    Returns first found value, using this order: POST, GET, default.
    :param request:
    :param key:
    :param default:
    :return:
    """

    value = request.POST.get(key, None) or request.GET.get(key, None)
    if value is not None:
        return value
    return default