27 - Saving Entries From Excel File to Django Database - Django | DRF | React w. Data Analysis

Опубликовано: 08 Октябрь 2024
на канале: Sugarloaf And a Cup of Joe
1,614
23

Openpyxl readthedocs page:
https://openpyxl.readthedocs.io/en/st...

About this video:
In this video we're mapping Excel file headers positions for further processing and bulk create Countries.

Video Content:
00:00 Intro
00:29 - Tweaks to get_header_and_units helper function
02:45 - Start going through Excel file rows
05:40 - Get Country by name or iso_code
12:11 - Start getting columns with handling empty cells
15:13 - Using get_or_create to either get object from database or create one
16:42 - Inline if statement
20:00 - Create model object using unpacked dictionary
21:18 - Delete query
22:25 - Save rows using bulk_create
22:46 - Handling non-POST requests
23:50 - Test how's everything working using debugger


About this tutorial:
The primary goal of this tutorial is to take you through the steps of creating a solid Django portfolio project that will stand out when you talk to your future employer.
Check out tutorial's intro to see if it's something for you:
   • 01 - Introduction to the course - Dja...  

Tutorial repo:
https://github.com/SugarloafAndACupOf...

Please hit SUBSCRIBE if you wanna get the notifications about the new content!
Also, like the hell out of this video if you find it useful/interesting!
Follow us on Facebook:   / sugarloaf-and-a-cup-of-joe-101638761829670  
and Instagram:   / sugarloaf_and_a_cup_of_joe