Python for Entrepreneurs Transcripts
Chapter: Build web apps with Pyramid: Part 1
Lecture: Building Block: Models
0:01 Let's look a little more carefully these models;
0:03 in practice, we'll probably use classes and sort of extract these models out of them,
0:08 but in their essence, a model is simply a dictionary, possibly containing lists
0:14 and more dictionaries itself.
0:15 So we are going to go to a list view of albums.
0:19 And, the list view needs three things about the album enabled to generate the list,
0:24 so it's going to need to know is there an audio preview it can let you listen to,
0:28 what is the title, what is the URL if you click it to view more details
0:32 or try to buy that album.
0:34 So notice, we are going to return a dictionary with the key called "albums" and within it,
0:39 it's going to basically, the value of that albums, is going to be a list of individual values
0:44 so we'll be able to loop over those in our template.