コード例 #1
0
def us_phonenumber_tag(number):
    """
    This is for backward compatibility.
    Don't use it.
    """
    import warnings
    warnings.simplefilter("always", "You're using us_phonenumber tag. You "
                          "should use a the filter with the same name.",
                          DeprecationWarning)
    return format_us_phonenumber(number)
コード例 #2
0
def us_phonenumber_tag(number):
    """
    This is for backward compatibility.
    Don't use it.
    """
    import warnings
    warnings.simplefilter("always", "You're using us_phonenumber tag. You "
                          "should use a the filter with the same name.",
                          DeprecationWarning)
    return format_us_phonenumber(number)
コード例 #3
0
def us_phonenumber_filter(value):
    try:
        return format_us_phonenumber(value)
    except phonenumbers.NumberParseException:
        # XXX: Swallow the exception
        return value
コード例 #4
0
def us_phonenumber_filter(value):
    try:
        return format_us_phonenumber(value)
    except phonenumbers.NumberParseException:
        # XXX: Swallow the exception
        return value