Building Data-Driven Web Apps with Flask and SQLAlchemy Transcripts
Chapter: Using SQLAlchemy
Lecture: Concept: Inserting data
0:00 We started off this chapter by demoing how to insert data.
0:03 Let's actually summarize now here at the end.
0:06 So again, we're going to create a session
0:09 which is the corresponding unit of work
0:11 bit of syntax in SQLAlchemy.
0:13 Then we're just going to allocate some objects
0:15 so here we're going to create a package
0:17 and set its ID and its author
0:19 maybe create some releases
0:22 set the release, not package value
0:25 other properties similarly relates to
0:27 set its package, we're going to add the package
0:29 call commit, whoosh!
0:31 All three that are seeing this because of the relationships
0:33 get inserted into the database; super easy!