1
00:00:00,180 --> 00:00:06,270
Hello, friend will come back in a previous video, we successfully display our message, right, so

2
00:00:06,270 --> 00:00:09,200
now I want to do want to work for our product model.

3
00:00:09,240 --> 00:00:12,600
So for doing this, we have to do we have to go to our own project.

4
00:00:12,600 --> 00:00:13,740
That means here.

5
00:00:14,400 --> 00:00:15,960
So that is our product model.

6
00:00:15,960 --> 00:00:21,930
And to create for our e-commerce site in our app shop, that is our application into the application.

7
00:00:21,930 --> 00:00:22,920
That is our model.

8
00:00:22,950 --> 00:00:26,970
OK, so you do this model idea what to do and to create two of this class.

9
00:00:26,970 --> 00:00:30,590
One will be for our category and also we need our product.

10
00:00:30,930 --> 00:00:34,700
So first of all, I want to do want to create one of the class for our category.

11
00:00:35,100 --> 00:00:39,120
So here at the front of the class and then I name it as a category.

12
00:00:40,110 --> 00:00:41,940
OK, I just name it as a category.

13
00:00:41,940 --> 00:00:46,650
And also, shall we inherited our model, that is the models and the model.

14
00:00:46,950 --> 00:00:48,470
So is simply the front of the model.

15
00:00:48,510 --> 00:00:48,910
OK.

16
00:00:49,290 --> 00:00:53,060
And after that, we have to do we have to define our field.

17
00:00:53,070 --> 00:00:56,450
And that is our field name for the category I define as a title.

18
00:00:57,600 --> 00:00:59,160
So the name, the the title.

19
00:00:59,160 --> 00:01:01,590
And then it shall be with the models.

20
00:01:01,620 --> 00:01:04,290
So with this model it will be as a character field.

21
00:01:07,080 --> 00:01:08,750
So should we as a character field.

22
00:01:08,760 --> 00:01:09,120
Right.

23
00:01:09,330 --> 00:01:16,050
And then also here I want to define some of the maximum length of that tribute as a maximum that is

24
00:01:16,050 --> 00:01:17,970
our maximum underscored length.

25
00:01:19,980 --> 00:01:24,930
So that simply defines the maximum length, maximum length I want to define as a party.

26
00:01:24,960 --> 00:01:30,820
OK, and also I define our one of the time that means here I define the creative time.

27
00:01:31,980 --> 00:01:35,020
So I just simply defined as a created OK created.

28
00:01:35,370 --> 00:01:39,330
And these models, it will be as a date time field.

29
00:01:43,140 --> 00:01:49,580
So it will be as adept and filled and also for the daytime feel here, which will be as it turned out,

30
00:01:50,130 --> 00:01:55,170
so I just simply defended ought to now add and make the things as a true.

31
00:01:57,090 --> 00:01:58,450
So I just simply defend the truth.

32
00:01:58,470 --> 00:02:01,890
I think you already knew about it so that all the time failed.

33
00:02:01,890 --> 00:02:07,020
And here I defended the auto ad that was usually automatically generated that time.

34
00:02:07,020 --> 00:02:07,310
Right.

35
00:02:07,740 --> 00:02:09,810
So now I also make the things that are true.

36
00:02:10,020 --> 00:02:18,420
And also after that I want to define our restraint so our esteem function on the line extreme and then

37
00:02:18,420 --> 00:02:20,280
here will be as a self.

38
00:02:21,210 --> 00:02:23,720
So same procedure we have to actually follow.

39
00:02:23,760 --> 00:02:26,460
OK, so that is ourselves and it is a self area.

40
00:02:26,460 --> 00:02:32,750
I want to return and to return our title that we with ourselves, with the self and return the title.

41
00:02:34,110 --> 00:02:39,270
And also here, if you want to define this step of one of the things like when you create any class,

42
00:02:39,270 --> 00:02:46,320
that means any table automatically you can see Snow added one of the is that I have created of the class

43
00:02:46,320 --> 00:02:51,780
as a profile, but in database automatically added another one as it is for the user.

44
00:02:51,790 --> 00:02:52,980
You can see Snow added that.

45
00:02:53,130 --> 00:02:55,690
So if you want to prevent it, then you can also prevent it.

46
00:02:55,710 --> 00:03:03,220
They have also the function for this one I show you like here I define that as a class class matter.

47
00:03:04,950 --> 00:03:12,130
So with this middle class here, we have to define the function as a verb was like a verb was under

48
00:03:12,150 --> 00:03:19,290
its name, underscore plural because he's automatically created on the plural.

49
00:03:19,290 --> 00:03:19,590
Right.

50
00:03:19,610 --> 00:03:22,350
So now I understand defining it as a catagories.

51
00:03:24,090 --> 00:03:26,220
So right now it shall be added.

52
00:03:26,220 --> 00:03:28,980
Make the things that it's just Kadugli, not the categories.

53
00:03:29,030 --> 00:03:35,520
OK, so I just simply find that things with this function as a verb, both names, plural, no one else

54
00:03:35,530 --> 00:03:38,330
wanted one to create another class for our product.

55
00:03:38,610 --> 00:03:42,340
So it's very much important for our e-commerce site, you name it as a product.

56
00:03:43,440 --> 00:03:50,130
OK, just name it as a product and also still be with our models and that our model is still we inherited

57
00:03:50,130 --> 00:03:52,140
our models and the model perfect.

58
00:03:52,170 --> 00:03:54,390
Now we have to do we have to define all that our field.

59
00:03:55,790 --> 00:04:01,560
So first of all, I want to define our film as a Ommaney miss, because he will be so important, I

60
00:04:01,850 --> 00:04:06,590
believe one of the main images and one of the main images is will be in our models.

61
00:04:06,600 --> 00:04:09,620
It will be as a type, will be as the images will type.

62
00:04:10,220 --> 00:04:13,550
So I just simply finish the images field.

63
00:04:14,630 --> 00:04:18,980
And here also we have to define our upload what exactly should be applauded.

64
00:04:19,550 --> 00:04:25,310
So I just simply applaud, underscore to upload to our to do and to create one of the folder name as

65
00:04:25,310 --> 00:04:25,910
a product.

66
00:04:27,050 --> 00:04:28,570
OK, so that is the product.

67
00:04:28,940 --> 00:04:30,960
So there is a product folder we have to do.

68
00:04:30,960 --> 00:04:31,610
We have to create it.

69
00:04:31,610 --> 00:04:36,510
Our media in the media area, I have created another folder as a product, a good friend.

70
00:04:36,870 --> 00:04:42,650
That is all that our product related emails will be saved, in particular that folder area and now also

71
00:04:42,650 --> 00:04:47,400
undertake another one has a name that is our product name with this model.

72
00:04:48,680 --> 00:04:51,410
So this model's here should be the character field.

73
00:04:52,130 --> 00:04:53,960
So it should be as a character field.

74
00:04:53,960 --> 00:04:57,260
And also here I define the maximum length.

75
00:04:58,010 --> 00:05:01,760
So there is a maximum length for this name.

76
00:05:01,760 --> 00:05:08,270
I want to define character limit as it 264 and also we need our categories because of all for every

77
00:05:08,270 --> 00:05:08,660
product.

78
00:05:08,660 --> 00:05:10,790
We have to select some of the specific categories.

79
00:05:10,910 --> 00:05:14,730
So here we have to define all of the foreign key for this category.

80
00:05:15,170 --> 00:05:17,030
So now I just name it as a category.

81
00:05:18,360 --> 00:05:23,420
And then with these models here, we have to define our foreign key.

82
00:05:28,710 --> 00:05:35,370
Foreign key will be our this category class, so here I just simply defined this category and also here

83
00:05:35,370 --> 00:05:40,270
we have to define as a on the elect, on underscore dialect.

84
00:05:41,430 --> 00:05:44,280
So on the left will be along with our models.

85
00:05:44,280 --> 00:05:51,210
And then this will be the cascade that means in this category will be elected, this category product

86
00:05:51,240 --> 00:05:52,260
will be also directed.

87
00:05:52,260 --> 00:05:52,600
OK.

88
00:05:53,040 --> 00:05:58,200
So here I defines the Cascade and also I define that name that is on the relation name as a related.

89
00:06:01,070 --> 00:06:08,660
Related underscore name, a related name will be as a category, whatever he wants right now, I'm just

90
00:06:08,660 --> 00:06:16,040
simplifying that name as a category and also undertake another field for our preview, tax preview,

91
00:06:16,040 --> 00:06:17,450
underscore text.

92
00:06:18,290 --> 00:06:24,530
And then here it shall be as our text field type text field.

93
00:06:26,330 --> 00:06:32,640
So it's obvious the text field and also here define the maximum length and for the maximum length here

94
00:06:32,660 --> 00:06:35,440
defined of the 200 200 character.

95
00:06:35,720 --> 00:06:37,910
And also here I want to define the level.

96
00:06:37,940 --> 00:06:40,590
So if you want to display that level, I think you already know about it.

97
00:06:40,610 --> 00:06:46,240
They have also of the attributes as a verb was named Soheir Defender, Vivus name.

98
00:06:46,550 --> 00:06:52,880
So the father's name is, to be sure, some of the lower level as a preview text.

99
00:06:53,890 --> 00:07:01,010
OK, so this step up on the verbal name, which the display and also need our details text so I that

100
00:07:01,040 --> 00:07:04,810
the details underscore text with these models.

101
00:07:06,110 --> 00:07:14,270
So this model is that we also have the TextField sorry text field and also here we have to define our

102
00:07:14,270 --> 00:07:15,160
maximum length.

103
00:07:15,170 --> 00:07:17,480
So I just simply defined the maximum length.

104
00:07:17,930 --> 00:07:20,030
And for this one I define as a one.

105
00:07:20,540 --> 00:07:24,200
OK, because the description will be a little bit excises.

106
00:07:24,200 --> 00:07:29,600
And also here I defended Obama's name and here Obama's name will be as a description.

107
00:07:32,060 --> 00:07:38,360
And then our prize surprise is also important for these wonderful models.

108
00:07:38,360 --> 00:07:41,900
And then it should be as a floor, another type as a flawed field.

109
00:07:44,490 --> 00:07:46,460
OK, just simply defined as a flawed field.

110
00:07:46,850 --> 00:07:55,010
And then another field I want to take as the old price all underscore sorry, all that this prize and

111
00:07:55,010 --> 00:08:00,020
this will be as a models and with these models also should be as a flawed.

112
00:08:01,640 --> 00:08:03,950
OK, so shall we also have the float field?

113
00:08:04,340 --> 00:08:06,630
And here I define some of the default value.

114
00:08:08,180 --> 00:08:14,110
OK, to simply define the default value as a zero point zero zero step up on the default value and define.

115
00:08:14,120 --> 00:08:19,700
And also that date will be needed so that simply funds are created, created.

116
00:08:19,700 --> 00:08:24,460
And for this created here will be the models and then the day time.

117
00:08:25,220 --> 00:08:27,250
So that will be the date time field.

118
00:08:27,260 --> 00:08:32,990
And also I make the things as an auto now add and make the things that are true.

119
00:08:34,710 --> 00:08:36,230
OK, I just simply defined the true.

120
00:08:37,350 --> 00:08:37,900
Perfect.

121
00:08:37,950 --> 00:08:43,020
So I hope he can learn a lesson about it, so here for our product plus I have defined some of the field

122
00:08:43,320 --> 00:08:50,660
as a main Ismay's name category preview, texte Delta X, XPrize, all prize uncreated.

123
00:08:50,850 --> 00:08:53,940
So if you want to add multiple field, you can also defining it.

124
00:08:53,940 --> 00:08:59,790
I think conceptually with a just like the same right now, stuck with me and now also defended the team.

125
00:08:59,940 --> 00:09:04,410
So that is our stream and also salvias itself.

126
00:09:04,980 --> 00:09:05,430
Right.

127
00:09:05,920 --> 00:09:12,540
And here I want to do and return return and the self and here and return whatever he wants right now

128
00:09:12,540 --> 00:09:14,090
and would want to return our name.

129
00:09:14,110 --> 00:09:16,900
So I just simply defined that name.

130
00:09:16,920 --> 00:09:22,770
OK, and also I want to make that our product will be as a descending order for the reasons here in

131
00:09:22,770 --> 00:09:23,490
our class.

132
00:09:24,300 --> 00:09:28,970
We have to define that metal right into the metro area here.

133
00:09:28,980 --> 00:09:32,700
I want to do and define as a ordering site.

134
00:09:32,790 --> 00:09:36,580
I have already discussed about the things we do with this product.

135
00:09:36,580 --> 00:09:39,500
Will we get the data from our database by the descending order?

136
00:09:39,810 --> 00:09:41,720
That is the last one will be as fast.

137
00:09:41,730 --> 00:09:46,680
So here I have to do I have to get the things without this create a date.

138
00:09:46,890 --> 00:09:47,760
So that was it.

139
00:09:47,940 --> 00:09:49,030
We get all the data.

140
00:09:49,350 --> 00:09:51,060
So here you have to define as a minus.

141
00:09:51,510 --> 00:09:54,420
OK, and then is the comma perfect?

142
00:09:54,660 --> 00:09:56,910
So now we have to do we have to migrate it.

143
00:09:56,910 --> 00:09:57,150
Right.

144
00:09:57,160 --> 00:10:01,440
So we have to migrate out this category and the product Nola's to that work.

145
00:10:01,440 --> 00:10:05,160
I just click as I say Voll OK, just click the save all.

146
00:10:06,360 --> 00:10:09,510
So now I just close it and now open our terminal.

147
00:10:11,140 --> 00:10:20,320
And now here I define as a pie and that manager pie and then make Migration's migration's and then I

148
00:10:20,320 --> 00:10:27,290
want to make our app undiscussable, so I just simply defend his app shop.

149
00:10:27,310 --> 00:10:36,280
There is a pie managed by MK Migration's an app shop to enter and now here showing you are trying to

150
00:10:36,280 --> 00:10:37,570
change that nullable.

151
00:10:37,570 --> 00:10:39,330
Feel for the address one.

152
00:10:40,180 --> 00:10:48,340
So there is this one actually, and that is if you go to our app logging into the app blocking, there

153
00:10:48,340 --> 00:10:50,940
is all models seem to the model area.

154
00:10:50,950 --> 00:10:53,050
I have defined that our length.

155
00:10:53,050 --> 00:10:55,420
That means blank.

156
00:10:55,420 --> 00:10:58,060
I define address.

157
00:10:58,060 --> 00:11:00,610
That is a maximum level that they define as a blank.

158
00:11:00,610 --> 00:11:00,980
True.

159
00:11:01,000 --> 00:11:07,210
OK, so here but I don't want to make that all the feel as a nullable that means are now so here defined

160
00:11:07,210 --> 00:11:11,680
as of now and here are defined now will be as true.

161
00:11:13,640 --> 00:11:18,940
And then also I don't want to add this for every field to every field.

162
00:11:18,940 --> 00:11:22,690
I want to define the now OK now true.

163
00:11:22,990 --> 00:11:24,040
This will be the null.

164
00:11:24,040 --> 00:11:24,700
True.

165
00:11:25,360 --> 00:11:27,460
And also I defended the null.

166
00:11:27,460 --> 00:11:27,850
True.

167
00:11:30,490 --> 00:11:35,050
So here I define it a natural, now I just click at the Save All.

168
00:11:36,880 --> 00:11:38,990
And now let's check this out.

169
00:11:39,010 --> 00:11:48,340
I want to turn to enter again and hear a as a one, but I just close it, close it and run it again.

170
00:11:49,660 --> 00:11:57,850
So here I just simply Savol and now able to run our migration again by and then Mannis dot by and let

171
00:11:57,850 --> 00:11:59,140
me migration's.

172
00:12:01,670 --> 00:12:10,390
Migrations and then I have to do have redefined our app underscores shop right to know, I just simply

173
00:12:10,580 --> 00:12:11,540
have to enter.

174
00:12:13,390 --> 00:12:19,480
Yeah, you can see snow perfectly getting that our of this table, that is I have created as a category

175
00:12:19,660 --> 00:12:20,920
and another is a product.

176
00:12:20,950 --> 00:12:24,390
OK, so here is getting that things for our discipled.

177
00:12:24,430 --> 00:12:27,740
I have to do I have to defend that as an animal, then it's a little better actually.

178
00:12:28,180 --> 00:12:29,240
So now it's OK.

179
00:12:29,290 --> 00:12:30,850
So now I just simply remove it.

180
00:12:31,330 --> 00:12:37,590
So now I have to work out where this model that is our category and also have created another one of

181
00:12:37,590 --> 00:12:38,140
the product.

182
00:12:38,440 --> 00:12:40,090
So now I have to do Intermagnetics.

183
00:12:40,090 --> 00:12:48,040
After that I defended the by and managed by and that makes it look like the enter.

184
00:12:49,520 --> 00:12:55,390
Yeah, now so successful, successfully magnet all that our data was stable, so now I have to do on

185
00:12:55,400 --> 00:13:01,460
to run our server so pie and the manager pie and then run server.

186
00:13:05,470 --> 00:13:10,440
And server, and after that, we have to do we have to also study.

187
00:13:10,700 --> 00:13:13,210
That means they start to have this model, right?

188
00:13:13,640 --> 00:13:20,020
That means here in our app shop or to that admin and the admin area, we have to do we have to register

189
00:13:20,020 --> 00:13:20,180
it.

190
00:13:20,500 --> 00:13:22,940
So now, first of all, we have to define our path.

191
00:13:22,960 --> 00:13:27,350
That means our form, our app, underscore shop.

192
00:13:27,640 --> 00:13:30,820
So from the shop area, that is our models.

193
00:13:31,840 --> 00:13:39,720
Right, that the models from here and want to import our Kadugli category and also the product that

194
00:13:39,760 --> 00:13:40,070
friend.

195
00:13:40,390 --> 00:13:43,750
So that is our app shop and that is our model.

196
00:13:43,750 --> 00:13:47,620
So into this models, I have created two of these as a category and the product.

197
00:13:47,920 --> 00:13:49,720
So now I just simply define two of these.

198
00:13:49,990 --> 00:13:52,190
And also after that we have to do we have to register it.

199
00:13:52,220 --> 00:13:56,280
So here it is for the admin and then site and the register.

200
00:13:57,580 --> 00:14:07,690
So register as our category and also on the on the register, another one as admin and inside the register

201
00:14:08,740 --> 00:14:11,110
and then our another one as a product.

202
00:14:11,470 --> 00:14:13,070
So just simply define that product.

203
00:14:13,330 --> 00:14:13,820
Perfect.

204
00:14:14,170 --> 00:14:17,770
So now if you click as the save all the save all.

205
00:14:19,360 --> 00:14:20,240
Check this out.

206
00:14:20,260 --> 00:14:24,760
Everything is running will now go to our database, that means here, refresh it.

207
00:14:25,830 --> 00:14:32,250
Now, go to our home base, yeah, you can see it's now perfectly added our category and our product.

208
00:14:32,270 --> 00:14:38,040
So if you go to that category, it is a category that I have defined that one field as a title.

209
00:14:38,070 --> 00:14:38,490
Right.

210
00:14:38,490 --> 00:14:40,410
And that will be automatically created.

211
00:14:40,830 --> 00:14:42,490
And also that is our product.

212
00:14:42,810 --> 00:14:48,240
So if you go to that ad product, you can see that is actually our email's function that we our mainly

213
00:14:48,750 --> 00:14:49,970
and that is our name.

214
00:14:49,980 --> 00:14:51,270
That is our category.

215
00:14:51,280 --> 00:14:55,800
So that is our category will be automatically loaded on here for the reasons here I have created on

216
00:14:55,920 --> 00:14:57,050
the warranty.

217
00:14:57,090 --> 00:14:57,340
Right.

218
00:14:57,630 --> 00:15:01,590
So that is our category will be loaded in particular that area.

219
00:15:01,620 --> 00:15:07,170
And here defined as a preview text, the description price and all price perfect.

220
00:15:07,380 --> 00:15:10,390
That piece will successfully migrate our database table.

221
00:15:10,410 --> 00:15:12,900
So here I have created two of this table.

222
00:15:12,930 --> 00:15:15,000
So that is our model into this model.

223
00:15:15,120 --> 00:15:17,170
I have created the category and the product.

224
00:15:17,580 --> 00:15:20,340
So now we have to do we have to visibly deprince here.

225
00:15:20,340 --> 00:15:22,880
We have to do we have to create one of the BU for this one.

226
00:15:22,890 --> 00:15:25,110
So but I don't want to continue this process.

227
00:15:25,110 --> 00:15:28,040
In our next video, I will show you that things with a live example.

228
00:15:28,560 --> 00:15:30,000
So thanks for watching.

229
00:15:30,030 --> 00:15:31,710
I will see you in the next video.
