1
00:00:01,180 --> 00:00:01,840
Welcome back.

2
00:00:02,320 --> 00:00:06,130
Now we need to do is that we need to start working on the project.

3
00:00:06,550 --> 00:00:14,770
So this was this this call that they have typed is just the the basic walk, and it's just a way to

4
00:00:14,800 --> 00:00:18,320
show you how you can start by.

5
00:00:18,470 --> 00:00:20,400
You think of the first route and the first function.

6
00:00:20,770 --> 00:00:23,980
But now let's start creating the replica of the project.

7
00:00:24,730 --> 00:00:34,120
So the project is going to get and insert and update and delete movies from the database.

8
00:00:34,600 --> 00:00:43,030
So it's a typical API that will allow you or users or people who are going to use your application.

9
00:00:43,030 --> 00:00:55,390
Typically the big corporations, these these corporations and these websites need a way to get data

10
00:00:55,810 --> 00:01:04,150
that they can use your API to get movies, to update movies, to the movies, to see movies.

11
00:01:05,050 --> 00:01:07,120
This project will allow them to do all of this.

12
00:01:07,540 --> 00:01:10,930
So the first thing that we need to do is that we need to create a.

13
00:01:11,940 --> 00:01:17,000
We need to create a route that is going to return all movies.

14
00:01:17,280 --> 00:01:18,510
We need to return everything.

15
00:01:19,050 --> 00:01:24,300
So to return everything, we need to create a new route and we already know how to get it.

16
00:01:24,540 --> 00:01:26,100
Let's now create a new route.

17
00:01:26,700 --> 00:01:33,660
So I'm going to create a new route of the app and then I'm going to say that to get and then.

18
00:01:35,300 --> 00:01:43,340
Or as a notice here that I'm using, get whenever we are returning, everything we use get requests.

19
00:01:43,970 --> 00:01:45,200
This is a rule of thumb.

20
00:01:45,200 --> 00:01:49,850
Whenever you need to know that whenever you are returning, everything you need to use the get, request,

21
00:01:49,910 --> 00:01:52,650
get and then you can hear.

22
00:01:53,600 --> 00:01:57,530
I specify the type of the the you are able that you want to use.

23
00:01:57,860 --> 00:02:00,320
You can't use force that you can use anything you want.

24
00:02:01,520 --> 00:02:08,090
Preferably you would need to use the name of the thing or things that you are returning.

25
00:02:08,480 --> 00:02:10,430
So in my case, I'm returning movies.

26
00:02:10,550 --> 00:02:17,990
Therefore, I'm going to say movies and then the function below to type or create the function that

27
00:02:17,990 --> 00:02:19,400
would return movies.

28
00:02:20,930 --> 00:02:22,160
Therefore, I'm going to take you there.

29
00:02:23,270 --> 00:02:24,140
I'm not going to be.

30
00:02:24,290 --> 00:02:29,180
I'm not going to be using the async because there is no need to do this, to do it, to do so with this

31
00:02:29,180 --> 00:02:29,510
function.

32
00:02:29,960 --> 00:02:32,990
This function is not going to be using the same technique.

33
00:02:33,500 --> 00:02:38,420
Even even this function hasn't used the async technique here.

34
00:02:38,420 --> 00:02:44,930
I just I have is just showing you that you can do this with the fast API, but you we don't need to

35
00:02:44,930 --> 00:02:45,290
use it.

36
00:02:46,370 --> 00:02:48,470
Now we need to get the function.

37
00:02:48,860 --> 00:02:52,880
So the function that would return all of the movies cannot be named anything.

38
00:02:53,270 --> 00:02:54,290
Of course you need to.

39
00:02:54,560 --> 00:02:57,530
You need to be consistent and you need to give it a meaningful name.

40
00:02:57,980 --> 00:03:04,520
So I'm going to say your get underscore movies, get movies, it's just going to return everything,

41
00:03:05,420 --> 00:03:08,750
and then I'm going to hear, say, return.

42
00:03:10,140 --> 00:03:12,260
And let's say Moody's.

43
00:03:14,010 --> 00:03:17,550
And we don't have this movie, so let's get a A..

44
00:03:19,140 --> 00:03:21,130
Let's get a variable called movies here.

45
00:03:21,370 --> 00:03:27,780
Movies, movies is equal to movies and let's say, for example.

46
00:03:28,740 --> 00:03:29,340
Title.

47
00:03:31,340 --> 00:03:31,940
And.

48
00:03:34,220 --> 00:03:34,740
Guy at all.

49
00:03:35,690 --> 00:03:37,610
Let's say Batman.

50
00:03:39,050 --> 00:03:40,670
And let's say also a year.

51
00:03:49,480 --> 00:03:53,800
So this this movie's array will retain only one singular movie.

52
00:03:54,460 --> 00:04:03,340
Let me see a list now this lady refresh, and if I refresh, as you can see now this duck that's provided

53
00:04:03,340 --> 00:04:08,080
by the cast, maybe I will list out all of the ordeals that you have.

54
00:04:08,470 --> 00:04:15,400
So we have to you or else we have them in your ear and we have this year which would return this.

55
00:04:16,890 --> 00:04:19,770
Get all movies.

56
00:04:20,460 --> 00:04:21,930
So this is going to return all of their movies.

57
00:04:21,960 --> 00:04:23,130
Let's check this out.

58
00:04:23,160 --> 00:04:23,970
Let me open it.

59
00:04:24,390 --> 00:04:33,760
And if you open it, as you can see it says here, successful response application, JSON string schema.

60
00:04:33,780 --> 00:04:36,480
So the response is successful.

61
00:04:36,960 --> 00:04:44,180
And in order to check the data that has been returned, which is in our case, it's in movies, every

62
00:04:44,220 --> 00:04:48,980
here with objects or dictionary you need to click through.

63
00:04:49,260 --> 00:04:52,650
Try it out if you click on dried out and then execute.

64
00:04:53,370 --> 00:04:57,770
This is going to return the data here, as you can see it, says Response Body.

65
00:04:57,790 --> 00:05:04,170
The responsibility is an array of objects, and in our case, we only have one object, which is the

66
00:05:04,440 --> 00:05:12,900
base object which returns its title and year of the response, whether it's content length, 32, content

67
00:05:12,900 --> 00:05:16,830
type, application JSON and the date, everything has been returned.

68
00:05:17,610 --> 00:05:21,510
So this is how we can implement your first.

69
00:05:21,540 --> 00:05:25,050
You are ill, which is which is returning movies here.

70
00:05:25,560 --> 00:05:27,240
In our case, we already 10 movies.

71
00:05:27,900 --> 00:05:30,360
You can add, of course, another object to showing you.

72
00:05:30,390 --> 00:05:33,210
Let me show you, for example, here I'm going to say title.

73
00:05:35,720 --> 00:05:37,010
And then I'm going to say.

74
00:05:38,680 --> 00:05:39,250
Joker.

75
00:05:40,120 --> 00:05:43,120
Joker, let's say, a year.

76
00:05:45,960 --> 00:05:47,400
2022, for example.

77
00:05:49,140 --> 00:05:51,480
When you refresh and execute.

78
00:05:55,480 --> 00:05:59,530
So if you execute, as you can see now, you are going to get to objects here.

79
00:05:59,560 --> 00:06:02,500
This is the first object and this is the second object.
