是否可以直接传递字典以在python中实例化另一个对象

use*_*629 2 python django dictionary

我正在尝试使用parse.com作为我的django应用程序的数据库.我已经安装了parse_rest.

我有一个字典列表,每个字典都有一个字典:

all_practices = {'a':value1, 'b':value2 ...}
Run Code Online (Sandbox Code Playgroud)

根据Michael Otte提供的答案,在django添加并保存对象到parse.com db

我可以通过以下方式保存此对象:

from parse_rest.datatypes import Object
class Profile(Object):
    pass

# instantiate with parameters
profile = Profile(name='Johnny', age=27)
Run Code Online (Sandbox Code Playgroud)

有没有办法直接传递字典对象作为配置文件对象的参数,以便得到:

profile = Profile(a='value1', b='value2')
Run Code Online (Sandbox Code Playgroud)