1
00:00:00,330 --> 00:00:00,960
Hello, friend.

2
00:00:00,990 --> 00:00:01,800
Welcome back.

3
00:00:02,010 --> 00:00:07,410
In a previous video, we have created one of the middle class as a car model class, and here I have

4
00:00:07,410 --> 00:00:13,410
defined all the Darfield right and also here a defense on the function, and that is our total function.

5
00:00:13,450 --> 00:00:16,010
So here with this, we can actually calculated that data.

6
00:00:16,500 --> 00:00:19,110
So now on to do want to create another class.

7
00:00:19,140 --> 00:00:22,070
So here are two defining of the class as a class order.

8
00:00:22,080 --> 00:00:24,900
And here we need our models and the model.

9
00:00:25,050 --> 00:00:25,360
Right.

10
00:00:25,650 --> 00:00:27,630
So don't want to do and define all the fields.

11
00:00:27,630 --> 00:00:30,650
So here I will still be, as I name it, as an order item.

12
00:00:31,170 --> 00:00:32,680
So order items.

13
00:00:32,700 --> 00:00:39,480
OK, so the disorder's items, this will be defined with our models and also it will be as a many to

14
00:00:39,480 --> 00:00:43,440
many relationship because of all customer can add multiple product.

15
00:00:43,440 --> 00:00:43,740
Right.

16
00:00:43,750 --> 00:00:46,010
So Austinmer can add multiple products.

17
00:00:46,020 --> 00:00:49,290
So these are all multiple product we have to define in our criteria.

18
00:00:49,290 --> 00:00:52,870
And also one order can add that multiple car data.

19
00:00:52,890 --> 00:00:56,800
So for the reasons here, you have to do have to defining it with our many too many.

20
00:00:56,820 --> 00:00:58,320
So just simply defined as many.

21
00:01:01,750 --> 00:01:08,650
OK, Manitoban field, so I just simply defended the Manitoban Ifield, so many too many issues will

22
00:01:08,650 --> 00:01:12,010
be with our which one is will be with our diskless as a card.

23
00:01:12,020 --> 00:01:14,980
So here I just simply defined that card.

24
00:01:15,610 --> 00:01:15,910
Right.

25
00:01:16,150 --> 00:01:18,880
So it would be one of the religion as a management relation.

26
00:01:19,150 --> 00:01:20,470
I just simply defining it.

27
00:01:20,770 --> 00:01:22,860
And also here we need our users.

28
00:01:22,870 --> 00:01:28,230
So will this user will create an ID card automatically will be created on the order.

29
00:01:28,240 --> 00:01:31,060
That means one of the order in particular, that order class area.

30
00:01:31,360 --> 00:01:33,640
So far, the results here are defined as the user.

31
00:01:33,650 --> 00:01:40,270
So it'll be just like the same with our models already, with our models, and it'll be the foreign

32
00:01:40,270 --> 00:01:44,450
key we have to call our foreign key will be in our setting.

33
00:01:45,310 --> 00:01:51,220
So that means the settings and then AWT and then also we have to define that only elect.

34
00:01:51,340 --> 00:01:55,900
So on the left will be with our models and then the cascade.

35
00:01:57,040 --> 00:01:57,420
Right.

36
00:01:57,430 --> 00:01:58,470
That means the cascade.

37
00:01:58,930 --> 00:02:01,500
And also here we have to define the order.

38
00:02:01,720 --> 00:02:03,940
That means our total order.

39
00:02:03,970 --> 00:02:04,570
I want to take.

40
00:02:04,580 --> 00:02:11,250
So you just simply defined as ordered, ordered and under the auditoria we have to define our condition.

41
00:02:11,590 --> 00:02:16,360
That means here I want to make the things of the bullet so it will be a little new.

42
00:02:16,360 --> 00:02:18,560
So we actually need it for our code base.

43
00:02:18,790 --> 00:02:24,700
So now I just simply defining it as a boolean fails to actually show you into the amount of funding,

44
00:02:24,700 --> 00:02:27,130
then everything will be very much clear to you.

45
00:02:27,400 --> 00:02:32,080
OK, so right now I just simply defined the order and the models with this model.

46
00:02:32,080 --> 00:02:36,520
I define the type as a boolean type and here I make that things as a default.

47
00:02:36,520 --> 00:02:37,000
False.

48
00:02:37,750 --> 00:02:39,590
OK, just make the default false.

49
00:02:41,110 --> 00:02:46,170
So that means when our any packages that we use are will any product.

50
00:02:46,510 --> 00:02:47,850
So that is actually purchased.

51
00:02:47,860 --> 00:02:49,630
I have defined as a false right.

52
00:02:49,840 --> 00:02:51,550
That means one still will be as a true.

53
00:02:51,610 --> 00:02:57,760
That means this purchase is complete and then it will be like a door ordered area and the order area

54
00:02:57,760 --> 00:02:58,390
by default.

55
00:02:58,390 --> 00:02:59,740
I make the things that are false.

56
00:02:59,770 --> 00:03:05,830
So when this user will complete this our order portion with the payment, then our dysfunction, that

57
00:03:05,830 --> 00:03:10,450
means this default will all be updated as a true OK, so we don't have to be the true.

58
00:03:10,450 --> 00:03:12,740
That means this order is totally completed.

59
00:03:13,180 --> 00:03:18,010
So here I just make that a default and also we need our created.

60
00:03:18,470 --> 00:03:20,080
So that is a created.

61
00:03:20,080 --> 00:03:23,780
And here with these models, it will be as a date time.

62
00:03:24,730 --> 00:03:31,190
So here I just simply defending the date time field and it shall be as auto, right.

63
00:03:31,240 --> 00:03:35,300
That means that auto now add and make as a true.

64
00:03:36,250 --> 00:03:40,660
So just simply defined as a true and then our payment idea also be needed.

65
00:03:41,940 --> 00:03:46,660
So I just simply defined as a payment, like a payment ID.

66
00:03:47,080 --> 00:03:51,040
And with this payment I do we can actually define our orders.

67
00:03:51,040 --> 00:03:56,470
So for the reasons here, I define with the payment, I will be as with our models, who will be the

68
00:03:56,470 --> 00:03:57,310
character field.

69
00:03:58,900 --> 00:04:04,540
OK, so we have the character field and here I define the maximum length, so maximum length will be

70
00:04:04,950 --> 00:04:06,500
either 254.

71
00:04:06,730 --> 00:04:07,520
OK, sorry.

72
00:04:08,540 --> 00:04:10,640
So just simply defined as the 264.

73
00:04:10,660 --> 00:04:14,620
And then on to do I have to make that as a blank.

74
00:04:16,150 --> 00:04:20,440
Blank will be a true and also I make the things as of now.

75
00:04:21,520 --> 00:04:25,080
So now it will be as a true set the simply defining it.

76
00:04:25,330 --> 00:04:30,500
And also we need our order I.D. So I just simply define our order I.D..

77
00:04:30,500 --> 00:04:35,980
So with this order, I.D. will be also the models and the models such as the character field.

78
00:04:36,910 --> 00:04:43,600
So character field here that defines the maximum length maximum limit for our disorder at the front

79
00:04:43,600 --> 00:04:48,800
of the two hundred and then make that as a blank blank will be as a true.

80
00:04:50,440 --> 00:04:54,880
And then also I make as a noun now as a true.

81
00:04:56,780 --> 00:04:58,440
OK, I just simply defending the true.

82
00:04:58,780 --> 00:05:03,250
That means so in our party it is complete when our total order is not complete.

83
00:05:03,260 --> 00:05:07,840
And also here you can see that now we have to do we have to actually find out our total amount.

84
00:05:07,840 --> 00:05:13,570
That means just six thousand and that our item to our total quantity prize are the two thousand.

85
00:05:13,570 --> 00:05:13,820
Right.

86
00:05:14,170 --> 00:05:17,790
So now we have to do have to define another things for getting our total amount.

87
00:05:18,040 --> 00:05:25,330
That means, shall we define our total and total amount will be as a two thousand and six hundred.

88
00:05:25,330 --> 00:05:25,840
That means that.

89
00:05:25,840 --> 00:05:27,630
Twenty six hundred.

90
00:05:27,640 --> 00:05:27,880
Right.

91
00:05:28,120 --> 00:05:29,620
So here we have to defining it.

92
00:05:29,980 --> 00:05:35,770
So now if you want to get this total amount, then we have to do we have to actually add on the loop.

93
00:05:35,770 --> 00:05:36,150
Right.

94
00:05:36,160 --> 00:05:40,000
Because first of all, it's a looping that data and take that out this amount.

95
00:05:40,150 --> 00:05:46,160
And after that it should loop again for get out this amount for the reasons I wanted to take on either

96
00:05:46,630 --> 00:05:47,710
one of the function.

97
00:05:48,250 --> 00:05:52,630
So I just am grateful that Dave and name it as a gate and Resko totals.

98
00:05:53,650 --> 00:05:58,420
OK, I just name it as a gate underscore totals and here I am to do it to defend itself.

99
00:05:58,660 --> 00:05:59,650
So it shall be as.

100
00:05:59,680 --> 00:06:05,190
Myself and then here I define our total amount will be studied from zero.

101
00:06:06,950 --> 00:06:09,890
So I just simply defended the total will be as a zero.

102
00:06:10,100 --> 00:06:14,150
And then I want to do how to define one of the four, which that means for Loop.

103
00:06:14,150 --> 00:06:18,640
I just simply want to for an hour order underscore item.

104
00:06:19,880 --> 00:06:25,070
So our order item in and then here we have to defend ourselves and would be self.

105
00:06:25,070 --> 00:06:27,210
I define our order items.

106
00:06:27,230 --> 00:06:33,460
OK, I just name it as the order items, so I just simply define our order items all the time.

107
00:06:33,470 --> 00:06:35,110
So that is our order items.

108
00:06:35,130 --> 00:06:36,160
All right.

109
00:06:36,170 --> 00:06:38,730
So now here we have to do we have to define our calculate.

110
00:06:39,010 --> 00:06:40,190
That means our total amount.

111
00:06:40,220 --> 00:06:45,730
So just improve on the total blousy equal to and they just make the thousands of flot.

112
00:06:46,940 --> 00:06:51,880
OK, just make as a flawed and it shall be added our this loop without this order item.

113
00:06:52,430 --> 00:06:56,870
So this order item and here it will be get our D total.

114
00:06:57,170 --> 00:06:58,670
That means that the total amount.

115
00:06:58,670 --> 00:06:59,030
Right.

116
00:06:59,030 --> 00:07:03,740
Because here as I told you so we looping our first of all these items that are that means total amount

117
00:07:04,400 --> 00:07:08,970
and then our second item data and then shall we get our total amount.

118
00:07:09,260 --> 00:07:11,510
So for the regions here, I have defined this condition.

119
00:07:11,520 --> 00:07:14,240
That means here I have defined the function as a total.

120
00:07:14,270 --> 00:07:17,660
So here we have to do we have to add our D total Lightford.

121
00:07:18,110 --> 00:07:19,630
So here I just simply add it.

122
00:07:19,880 --> 00:07:24,150
And after that I want to do and define the return and return our total.

123
00:07:24,950 --> 00:07:27,960
So I just simply define our D total amount.

124
00:07:27,980 --> 00:07:29,690
So that is our total perfect.

125
00:07:29,810 --> 00:07:33,550
So now whatever we purchase or whatever we purchase from Jakarta.

126
00:07:33,970 --> 00:07:39,020
So when we actually make that order compete, then we have to complete it with our total amount.

127
00:07:39,020 --> 00:07:39,260
Right.

128
00:07:39,540 --> 00:07:40,340
What regions here?

129
00:07:40,340 --> 00:07:42,880
I have defined our total amount with our totals.

130
00:07:43,070 --> 00:07:48,230
So I think it's now very clear to use in I want to do I want to migrate it because here we have to migrate

131
00:07:48,230 --> 00:07:49,270
out of this table.

132
00:07:49,280 --> 00:07:51,310
That means our order and our card.

133
00:07:51,320 --> 00:07:51,610
Right.

134
00:07:51,980 --> 00:07:53,170
So now let's do that work.

135
00:07:53,180 --> 00:07:54,610
I just have to save all.

136
00:07:55,430 --> 00:07:59,610
And now here I want to do you can see there's also some of the error.

137
00:07:59,630 --> 00:08:03,250
So that is our unexpected or total now.

138
00:08:03,980 --> 00:08:07,040
So that is our you can see I defined as the auto.

139
00:08:07,190 --> 00:08:08,870
So that will be as auto.

140
00:08:08,870 --> 00:08:11,990
And then now and then our true.

141
00:08:13,590 --> 00:08:21,060
OK, and I want to just clear the table again, so better in our view into the video and to make the

142
00:08:21,060 --> 00:08:25,260
changes that need to be lowered, I can actually talk here, but I disclose it.

143
00:08:25,270 --> 00:08:34,690
OK, just disclose it and run this over again as a pie and then manage the pie and then run server because

144
00:08:34,720 --> 00:08:35,430
they enter.

145
00:08:39,970 --> 00:08:47,060
Yeah, you can see snow perfectly running, so now I to turn to magnets or here, so here I just click

146
00:08:47,090 --> 00:08:47,980
the save all.

147
00:08:51,540 --> 00:08:56,730
Yeah, everything is running well, so no one to make it better in the closet and now open up time,

148
00:08:56,730 --> 00:08:59,790
you know, so no one to make it out is to have this model.

149
00:09:00,240 --> 00:09:05,010
That means here I have created as a water and also I have created another one in the cart.

150
00:09:05,340 --> 00:09:08,160
So you have to migrate it like they did.

151
00:09:08,190 --> 00:09:09,560
And I think you already know about it.

152
00:09:09,570 --> 00:09:14,310
You have to define as a buy and then buy and then and then make migration's

153
00:09:16,890 --> 00:09:21,750
make migration's and our app name, our app name as app underscore order.

154
00:09:22,710 --> 00:09:27,380
So just simply define our apple because of all that is our application name.

155
00:09:27,390 --> 00:09:28,220
That is our airport.

156
00:09:28,290 --> 00:09:28,590
Right.

157
00:09:28,620 --> 00:09:33,590
So now I just click enter so you can see is a spelling mistake.

158
00:09:34,170 --> 00:09:45,840
So here we have to define as a pie and then manners dot pie and that make migration's and then app underscore

159
00:09:46,260 --> 00:09:49,140
order not click enter.

160
00:09:50,950 --> 00:09:55,480
Yeah, you can see now it's perfectly getting created out of this model that is are one of the cars.

161
00:09:55,510 --> 00:09:56,570
Another is our order.

162
00:09:56,890 --> 00:09:59,470
So no one do I want to migrate it.

163
00:09:59,470 --> 00:10:03,830
So by and then managed up by and then migrate.

164
00:10:05,200 --> 00:10:09,580
So to simplify it by madness by and the magnetic liquors enter.

165
00:10:11,260 --> 00:10:14,660
Yeah, you can successfully initialize all that our table.

166
00:10:15,070 --> 00:10:21,640
So now if you want to visit, we have to do we have to visibility Nawaat admin, so that is in our app.

167
00:10:21,640 --> 00:10:23,140
Go to the admin party.

168
00:10:23,530 --> 00:10:25,960
And here, first of all, we have to input both of these.

169
00:10:25,980 --> 00:10:29,950
So from our app, that is our app order.

170
00:10:31,330 --> 00:10:31,660
Right.

171
00:10:31,690 --> 00:10:39,210
So from our app orders that the models so from our app orders and other modules and here we have created

172
00:10:39,250 --> 00:10:41,260
to have this class.

173
00:10:41,290 --> 00:10:42,730
So here we have to import.

174
00:10:42,730 --> 00:10:44,350
So import our card.

175
00:10:45,110 --> 00:10:47,300
And also I have created an order.

176
00:10:47,620 --> 00:10:47,960
Right.

177
00:10:47,980 --> 00:10:51,420
So I just simply import most of this so I don't have to do have to register it.

178
00:10:51,430 --> 00:10:58,720
So you don't add admin and then the site and then our register and with the register area we have to

179
00:10:58,720 --> 00:10:59,610
add our cart.

180
00:11:00,460 --> 00:11:07,930
So I just simply the card and also in our admin side and the register and here we have to do have to

181
00:11:07,930 --> 00:11:08,750
add our order.

182
00:11:09,280 --> 00:11:11,080
So I just simply defied that order.

183
00:11:11,320 --> 00:11:16,380
So now if you click on this all, I just clicked to save all and go to our server.

184
00:11:16,420 --> 00:11:18,820
That means our back in the refresh.

185
00:11:22,000 --> 00:11:23,890
So I didn't dinosauria, maybe.

186
00:11:25,320 --> 00:11:32,640
Yeah, I wouldn't want to support the pie and by and then run server enter.

187
00:11:35,570 --> 00:11:38,920
Our service is now running and now I just do it again.

188
00:11:40,600 --> 00:11:45,690
Yeah, you can see now we have also added in our app order, that is our card and that is our order,

189
00:11:45,730 --> 00:11:46,060
right.

190
00:11:46,540 --> 00:11:50,290
So that is our order position and also that is our card position.

191
00:11:50,560 --> 00:11:51,030
Perfect.

192
00:11:51,430 --> 00:11:54,000
So now I have to do I have to add these products.

193
00:11:54,010 --> 00:11:56,700
So I have to add this product in our card area.

194
00:11:56,710 --> 00:11:58,540
So first of all, we have to set up it.

195
00:11:58,720 --> 00:12:04,150
And when this product will be added and then it should be added our this product in our card area and

196
00:12:04,150 --> 00:12:07,210
also in our order area so we can do that work.

197
00:12:07,210 --> 00:12:10,260
In our next video, I will show you that things with a live example.

198
00:12:10,630 --> 00:12:12,090
So thanks for watching.

199
00:12:12,100 --> 00:12:13,720
I will see you in the next video.
