paweloque
paweloque

Reputation: 18864

Creating elasticsearch-dsl DocType objects from dict or json

I'm using the elasticsearch-dsl library to define mappings in elasticsearch and to index django model objects. For initial indexing I, however, want to use json data for all models. Is there a way to instantiate DocType subclass objects directly from json or from a python dict?

Upvotes: 1

Views: 970

Answers (1)

Honza Král
Honza Král

Reputation: 3022

You can always do MyDoc(**my_dict)

Upvotes: 2

Related Questions