pyexcel save to Django model

46 Views Asked by At

Having difficulties understanding the documentation for interaction between dest_initializer and dest_model?

If I have a Django model like:

class MyModel(Model)
    file = FileField()

How can I write a file to an instance of this model?

instance = MyModel()

records = [OrderedDict([("Test Key", "Test Value")])]
pyexcel.save_as(
                records=records,
                dest_model=MyModel,
                ...... ?????? How to write to instance.field?
            )
0

There are 0 best solutions below