March 2020
Intermediate to advanced
608 pages
17h 17m
English
The principle of importing from an XLSX file is the same as with CSV. We open the file, read it row by row, form data dictionaries, validate them via a model form, and create the Song objects from the provided data.
Again, we are using the prepare(), main(), and finalize() methods to split the logic into more atomic parts.
Here is a detailed explanation of the main() method as it is probably the only different part of the management command: