1
00:00:05,370 --> 00:00:06,210
Welcome back.

2
00:00:06,210 --> 00:00:09,970
It's time to complete this section of the Course by giving you a project.

3
00:00:10,050 --> 00:00:14,910
So let's do an overview of the project and the next lecture will start the solutions.

4
00:00:14,990 --> 00:00:16,470
So we're going to test new skills.

5
00:00:16,490 --> 00:00:19,280
And there's three main options for approaching this project.

6
00:00:19,280 --> 00:00:24,110
One is to just treat the solutions as a code a long lecture so you can do is if you really enjoyed the

7
00:00:24,110 --> 00:00:28,200
previous series of lectures as a long project and that's how you prefer learning.

8
00:00:28,310 --> 00:00:29,790
Just go ahead and treat the solutions.

9
00:00:29,900 --> 00:00:31,970
Coming up next as a code along project.

10
00:00:32,270 --> 00:00:37,590
The second option is to follow along with the suggested steps inside the instructions that textfile.

11
00:00:37,680 --> 00:00:43,370
So inside the database folder there's a database project instructions textfile the has at the end some

12
00:00:43,370 --> 00:00:48,740
bulleted instructions for you to follow to help break down the actual project and then the third option

13
00:00:48,800 --> 00:00:50,570
and this is for the most challenging approach.

14
00:00:50,570 --> 00:00:55,250
For the most ambitious students is after reviewing the example video that we're about to show what a

15
00:00:55,250 --> 00:01:00,170
solution may look like in the web browser just begin coding and see if you can't figure it out completely

16
00:01:00,170 --> 00:01:00,940
on your own.

17
00:01:01,280 --> 00:01:06,770
So if that being said I wanted to show you the completed actual product is going to look like we're

18
00:01:06,770 --> 00:01:11,930
going to add some functionality onto the previous web site and then you can decide what approach works

19
00:01:11,930 --> 00:01:12,880
best for you.

20
00:01:12,920 --> 00:01:14,710
So let's see what you're actually going to be building.

21
00:01:14,850 --> 00:01:18,520
All right so this is what the final project solution is going to look like.

22
00:01:18,560 --> 00:01:24,740
It's actually the same website as before but now we've added ONE MORE tab for adding owners so we still

23
00:01:24,740 --> 00:01:27,860
have ADD PUP list of pups and Duleep pup.

24
00:01:27,950 --> 00:01:34,160
But now if you click on Add owner you should see the ability to provide the name of the owner and the

25
00:01:34,160 --> 00:01:38,520
idea of a puppy that's currently in the database and then add the owner and connect that.

26
00:01:38,690 --> 00:01:41,960
So if you look at the list of pups you should see something like this.

27
00:01:41,990 --> 00:01:46,640
The puppy name and then the owner is and then whatever the owner you linked to them is.

28
00:01:46,820 --> 00:01:51,230
So it says something like puppy name is just a made up name third's and has no owner assigned to it

29
00:01:51,530 --> 00:01:57,380
or puppy name is Sammies and the owner is Mimi etc. So to be able to add a pup.

30
00:01:57,380 --> 00:02:01,970
Check out the list the pups and now reports back there owner if they have an owner assigned you can

31
00:02:01,970 --> 00:02:05,010
still remove pups and then you can add owners.

32
00:02:05,020 --> 00:02:10,790
And as far as these models of adding and connecting an owner to a puppy We've actually already covered

33
00:02:10,790 --> 00:02:12,120
that in the relationships.

34
00:02:12,140 --> 00:02:18,050
Lectures in the database section of the course so we already know how to add and connect those relationships

35
00:02:18,170 --> 00:02:20,730
inside between owners and puppies.

36
00:02:20,870 --> 00:02:26,000
Now what you need to do is combine all of that by adding a new template for adding and owners and then

37
00:02:26,000 --> 00:02:28,950
connecting them and adding them in on the back end.

38
00:02:28,970 --> 00:02:32,950
So essentially it's a lot of stuff that we've already done before but you just need to connect it to

39
00:02:32,950 --> 00:02:35,820
the templates and add that functionality to the Web site.

40
00:02:35,870 --> 00:02:41,330
So if you're feeling really ambitious Just knowing this information go ahead and try to do it on your

41
00:02:41,330 --> 00:02:41,890
own.

42
00:02:42,140 --> 00:02:47,240
Now we're going to head back to the slides and give you some suggested steps for actually adding in

43
00:02:47,480 --> 00:02:49,350
additional functionality to the Web site.

44
00:02:49,510 --> 00:02:53,240
OK let's discuss some suggested steps for this project.

45
00:02:53,270 --> 00:02:57,340
I would recommend the following procedure steps for tackling this project.

46
00:02:57,350 --> 00:03:01,580
First copy your paste or duplicate the database in views folder.

47
00:03:01,580 --> 00:03:06,960
That's the 0 3 databases and views folder and then add in an owner's model.

48
00:03:07,040 --> 00:03:12,830
Very similar to the model we created in the relationships lecture's that was Section 2 and you have

49
00:03:12,830 --> 00:03:14,860
all those files already from the flask.

50
00:03:14,860 --> 00:03:16,570
Boot camp repo.

51
00:03:16,940 --> 00:03:20,030
Then create a relationship between puppies and owners.

52
00:03:20,030 --> 00:03:27,610
That one to one relationship then update the R EPR method for puppies in order to display the owner.

53
00:03:27,610 --> 00:03:32,750
Now remember we have the if statement to let us know if we want to display them as no owner assigned

54
00:03:32,960 --> 00:03:34,190
or the owner name.

55
00:03:34,430 --> 00:03:40,870
Then use the flask D-B command line arguments such as Flast to be in the flask D-B migrate and flask

56
00:03:40,880 --> 00:03:47,180
the upgrade in order to actually migrate and upgrade those changes to the owner model because remember

57
00:03:47,390 --> 00:03:53,590
just adding in that model file or model class in your python script will actually affect the database.

58
00:03:53,600 --> 00:03:59,360
You need to do the Flast DBI commands in order to update the sequel like database.

59
00:03:59,390 --> 00:04:04,850
Once you've done that you should create a view in a form that lets you add new owners to your database

60
00:04:04,940 --> 00:04:09,860
and when you add these owners you should be connecting them to a puppy by puppy ID and then what would

61
00:04:09,860 --> 00:04:16,790
be really cool is if you flash a message upon creating a new owner stating the new owners name.

62
00:04:16,950 --> 00:04:20,670
Then you can go back to the list view to confirm the new owner and puppy.

63
00:04:20,700 --> 00:04:24,620
Keep in mind there's lots of possible solutions in the next series of lectures.

64
00:04:24,660 --> 00:04:30,150
We're going to go over the example of just one solution but I would really say take advantage of the

65
00:04:30,150 --> 00:04:33,080
code you've already written for you in the previous topic lectures.

66
00:04:33,180 --> 00:04:39,840
Copying and pasting from the 0 3 file and folder and then adding on is going to save you a lot of time.

67
00:04:39,840 --> 00:04:45,090
What I would suggest though is that you don't overwrite existing provided note files instead make copies.

68
00:04:45,210 --> 00:04:48,520
That way you have the correct solutions to always refer back to.

69
00:04:48,570 --> 00:04:50,310
In case you want to get started again.

70
00:04:50,610 --> 00:04:51,360
All right.

71
00:04:51,360 --> 00:04:52,490
Best of luck on the project.

72
00:04:52,530 --> 00:04:56,790
Remember you can treat this as a code along but you're skipping over to the next lecture or we go over

73
00:04:56,850 --> 00:04:58,210
an example solution.

74
00:04:58,320 --> 00:04:58,940
We'll see if there.
