【发布时间】:2017-07-25 07:58:35
【问题描述】:
我正在使用elasticsearch-dsl 库来定义elasticsearch 中的映射并索引django 模型对象。但是,对于初始索引,我想对所有模型使用 json 数据。有没有办法直接从json 或python dict 实例化DocType 子类对象?
【问题讨论】:
标签: python json django elasticsearch-dsl
我正在使用elasticsearch-dsl 库来定义elasticsearch 中的映射并索引django 模型对象。但是,对于初始索引,我想对所有模型使用 json 数据。有没有办法直接从json 或python dict 实例化DocType 子类对象?
【问题讨论】:
标签: python json django elasticsearch-dsl
你总是可以MyDoc(**my_dict)
【讨论】: