Q:

How to change values/types of Dictionary and put them back

I have a form that captures a users details, on this form I have many radio button groups which values are true and false. And I also have multi select boxes, which I need to convert to a list.
I want to convert these fields to Boolean and to a list before serializing to JSON and sending them to the server-side. Currently I am converting these values on the Server-side.
When I serialize it sends NestedMultiDict, which is a Dictionary of list of tuples.
I need to cast the values of the radio buttons(currently string) to Boolean and put the values of the multi select in a list.
This is how I am dong it currently:
jQuery/AJAX:
$("button").click(function(e) {
            e.preventDefault();
            $("input,select,textarea").jqBootstrapValidation();
            var url = "{{'candidates.json'|route_url}}";
            var data = $("form[name=modify]").serialize();

            console.log(data);
            //console.log(data);
            $.post(url, data).success(function() {
                update_messages();
            }).error(function() {
                console.log(url);
                alert("failed");
            });
        });

Python: 
def getBool(**d):
        for k,v in d.iteritems():
            if v == "True":
                d[k] = True            
                print "true",d[k]
            elif v == "False":
                d[k] = False
                print "false",d[k]
        return d

The problem comes when I need to put the multi select values into a list and back into the dictionary. I do not know how to convert the values and then put them back into the dictionary.
Is it possible to do this? If so, how could I accomplish this? 
As a side question: what is the most efficient way way this could be done?

A:

I changed my bool function a bit so that it looks like:
def bool(boolean):
    if boolean == "True":
        return True
    else:
        return False

And now in my Python function that I handle the serialized data send with the Ajax request I just do this:
if self.context.relocate:
            self.context.relocate = bool(self.context.relocate)

I found that I do not need to put it back into the NestedMultiDict as self.context handles the data that should be inserted into the database. So now I save my data to the database without worrying about putting data back into a Dict... 
I use a framework called Pyramid with MongoDB and MongoEngine(just so the above code makes more sense).
I hope this can help someone.

