1 00:00:00,000 --> 00:00:00,211 2 00:00:00,211 --> 00:00:02,210 SPEAKER 1: Once a user makes a purchase, they'll 3 00:00:02,210 --> 00:00:04,340 be redirected to the index page. 4 00:00:04,340 --> 00:00:08,240 So, let's edit that to reflect the user's portfolio. 5 00:00:08,240 --> 00:00:13,430 In this display for index, we'll want to show an HTML table that 6 00:00:13,430 --> 00:00:17,030 shows the user's portfolio, the stocks that they own, 7 00:00:17,030 --> 00:00:21,290 the shares of each stock that they own, the current price of each stock, 8 00:00:21,290 --> 00:00:24,830 and the total value of each holding that they have. 9 00:00:24,830 --> 00:00:28,940 In addition to that, we'll want to show the user's current cash balance, as 10 00:00:28,940 --> 00:00:31,100 well as the grand total of their value. 11 00:00:31,100 --> 00:00:36,110 So, the cash plus all of the value of their shares. 12 00:00:36,110 --> 00:00:39,890 That's a lot of information from the database, and retrieving that will all 13 00:00:39,890 --> 00:00:43,910 be done in Python, so we'll have rows upon rows of information 14 00:00:43,910 --> 00:00:47,030 that we'll then want to display in HTML. 15 00:00:47,030 --> 00:00:51,230 But how do we do that without including lines and lines for every single row 16 00:00:51,230 --> 00:00:52,730 that we have? 17 00:00:52,730 --> 00:00:57,350 Well, luckily there's documentation within Ginga that allows us to do this. 18 00:00:57,350 --> 00:00:59,540 Take this for loop, for example. 19 00:00:59,540 --> 00:01:04,400 Say within the Python file I've called render template 20 00:01:04,400 --> 00:01:06,870 and passed in an array of stocks. 21 00:01:06,870 --> 00:01:09,410 Well, then this for loop allows me to iterate over 22 00:01:09,410 --> 00:01:15,260 every single stock in stocks, and will display the stock name. 23 00:01:15,260 --> 00:01:19,640 So, think of which variables you need to pass into index.html, 24 00:01:19,640 --> 00:01:23,530 and what information you need to show. 25 00:01:23,530 --> 00:01:24,566