There's more...

You can learn more about the CSV library from the official documentation at https://docs.python.org/2/library/csv.html.

It also is possible to generalize this command into a form usable for any app and model. To do so, we need to accept the app and model to import to as additional arguments. Also, the first row (the column headings) has to be provided and contain the model field names. From these, in combination with the row data, we construct a kwargs object and pass that to get or create an instance of the appropriate app model. We leave the implementation of such a generalized command as an exercise for the reader.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.127.141