Python for Entrepreneurs Transcripts
Chapter: Build web apps with Pyramid: Part 1
Lecture: Building Block: Models

Login or purchase this course to watch this video and the rest of the course contents.
0:01 Let's look a little more carefully these models; in practice, we'll probably use classes and sort of extract these models out of them,
0:09 but in their essence, a model is simply a dictionary, possibly containing lists and more dictionaries itself.
0:16 So we are going to go to a list view of albums. And, the list view needs three things about the album enabled to generate the list,
0:25 so it's going to need to know is there an audio preview it can let you listen to,
0:29 what is the title, what is the URL if you click it to view more details or try to buy that album.
0:35 So notice, we are going to return a dictionary with the key called "albums" and within it,
0:40 it's going to basically, the value of that albums, is going to be a list of individual values so we'll be able to loop over those in our template.

Talk Python's Mastodon Michael Kennedy's Mastodon