I want to use a python dict to store variable references and be able to assign the values pointed out by those references.
foo = "foo"
d = {'foo' : foo}
d['foo'] = "bar"
foo
// output: 'foo', but I want it to be 'bar'.
How can I accomplish this?
Edit: Some actual code.
settings = values["settings"] // This is a dict, such as {"metoder_alphasort" : "on"}
field_map = {"metoder_alphasort" : profile.metoder_alphasort}
for setting in field_map.keys():
if settings.has_key(setting):
if settings[setting] == 'on':
field_map[setting] = True
# field_map[setting] is now True, but profile.metoder_alphasort is False