ganggu/forms.py
def html_params(**kwargs):
    """
    Generate HTML parameters from inputted keyword arguments.
    """
    params = []
    for k, v in sorted(iteritems(kwargs)):
        if k.endswith("_"):
            k = k[:-1]
        elif k.endswith("__"):
            k = k[:-2]
        else:
            k = k.replace("_", "-")  # PATCH HERE: data_custom => data-custom
        if v is True:
            params.append(k)
        elif v is False:
            pass
        else:
            params.append('%s="%s"' % (text_type(k),
                                       escape(text_type(v), quote=True)))
    return " ".join(params)

    Generate HTML parameters from inputted keyword arguments.
    
Generate HTML parameters from inputted keyword arguments.
Generate HTML parameters from inputted keyword arguments .
def html_params(**kwargs):
    params = []
    for k, v in sorted(iteritems(kwargs)):
        if k.endswith("_"):
            k = k[:-1]
        elif k.endswith("__"):
            k = k[:-2]
        else:
            k = k.replace("_", "-")  
        if v is True:
            params.append(k)
        elif v is False:
            pass
        else:
            params.append('%s="%s"' % (text_type(k),
                                       escape(text_type(v), quote=True)))
    return " ".join(params)
def html_params ( ** kwargs ) : params = [ ] for k , v in sorted ( iteritems ( kwargs ) ) : if k . endswith ( "_" ) : k = k [ : - 1 ] elif k . endswith ( "__" ) : k = k [ : - 2 ] else : k = k . replace ( "_" , "-" ) if v is True : params . append ( k ) elif v is False : pass else : params . append ( '%s="%s"' % ( text_type ( k ) , escape ( text_type ( v ) , quote = True ) ) ) return " " . join ( params )
Generate HTML parameters from inputted keyword arguments.
Generate HTML parameters from inputted keyword arguments .
"""
    Generate HTML parameters from inputted keyword arguments.
    """ # PATCH HERE: data_custom => data-custom