def parse_html_dict(dictionary, prefix=''):
    """
    Used to support dictionary values in HTML forms.

    {
        'profile.username': 'example',
        'profile.email': 'example@example.com',
    }
        -->
    {
        'profile': {
            'username': 'example',
            'email': 'example@example.com'
        }
    }
    """
    ret = MultiValueDict()
    regex = re.compile(r'^%s\.(.+)$' % re.escape(prefix))
    for field, value in dictionary.items():
        match = regex.match(field)
        if not match:
            continue
        key = match.groups()[0]
        ret[key] = value
    return ret
def parse_html_dict ( dictionary , prefix = '' ) : ret = MultiValueDict ( ) regex = re . compile ( r'^%s\.(.+)$' % re . escape ( prefix ) ) for field , value in dictionary . items ( ) : match = regex . match ( field ) if not match : continue key = match . groups ( ) [ 0 ] ret [ key ] = value return ret
Used to support dictionary values in HTML forms.

    {
        'profile.username': 'example',
        'profile.email': 'example@example.com',
    }
        -->
    {
        'profile': {
            'username': 'example',
            'email': 'example@example.com'
        }
    }