1
00:00:00,300 --> 00:00:01,920
Hello, friend, welcome back.

2
00:00:02,340 --> 00:00:08,070
In a previous video I have already discussed about the things, our view of the model, so now we will

3
00:00:08,070 --> 00:00:08,790
create it.

4
00:00:09,000 --> 00:00:10,820
OK, so now we will create all the models.

5
00:00:10,830 --> 00:00:12,000
Right now we don't need this.

6
00:00:12,000 --> 00:00:14,000
I just simply remove it from here.

7
00:00:14,400 --> 00:00:19,440
So not only do I want to create on the table and also for this table, I want to define some of the

8
00:00:19,440 --> 00:00:19,810
field.

9
00:00:20,370 --> 00:00:25,320
So if you want to create it, first of all, you have to define that class size or simply define the

10
00:00:25,320 --> 00:00:25,740
class.

11
00:00:25,740 --> 00:00:29,930
And I want to do and to create one of the class name as a musician.

12
00:00:31,560 --> 00:00:36,510
OK, and into this musician, I just simply defined as a model that means our model slavery.

13
00:00:36,510 --> 00:00:40,050
So I just simply defined model and into this model slavery.

14
00:00:40,050 --> 00:00:42,360
I don't need to create one of the model class.

15
00:00:42,360 --> 00:00:46,350
So I just simply defined as a model, OK, just simply defined as a model.

16
00:00:47,220 --> 00:00:52,110
So now I want to do and define our field like here for the musician pibil.

17
00:00:52,110 --> 00:00:57,510
I want to define some of the fast name fast and that is the name of the field.

18
00:00:57,720 --> 00:00:59,890
And then with this model slavery.

19
00:01:01,290 --> 00:01:05,940
So with this model slavery, I want to define some of the type like here I define as a character type,

20
00:01:09,270 --> 00:01:09,550
OK?

21
00:01:09,570 --> 00:01:13,710
Just simply defined as the character field type and for the character filtered by defined as a maximum

22
00:01:13,710 --> 00:01:14,100
length.

23
00:01:18,310 --> 00:01:23,260
OK, this simply defined as character and character, and I just simply defined for this field as a

24
00:01:23,940 --> 00:01:29,690
real good friend and also I want to create another field so better I just compete.

25
00:01:29,710 --> 00:01:30,990
I want to create three field.

26
00:01:31,000 --> 00:01:34,090
One will be as a first name, one will be as a last name.

27
00:01:34,970 --> 00:01:36,910
So I just simply defined the last name.

28
00:01:36,910 --> 00:01:39,200
And with these models, that means that is our model.

29
00:01:39,220 --> 00:01:40,840
So I really would do this model.

30
00:01:40,840 --> 00:01:44,680
I want to access our one of the type as a character field type.

31
00:01:44,860 --> 00:01:50,940
And for this field, I also want to define that Maximilien will be as a 50 and also on the define another

32
00:01:50,950 --> 00:01:53,350
field and this field will be the instrument.

33
00:01:55,850 --> 00:02:01,040
I just name it as an instrument, and with this model, I also do find the type will be as a character

34
00:02:01,040 --> 00:02:01,610
field type.

35
00:02:01,640 --> 00:02:05,230
And here I define that maximum length as a one hundred character.

36
00:02:05,540 --> 00:02:10,840
So I just simply defined as the one that character and also I want to do to create another class.

37
00:02:10,840 --> 00:02:12,240
So I just simply defined the class.

38
00:02:13,250 --> 00:02:14,710
So I just simply defended the class.

39
00:02:14,720 --> 00:02:17,190
And here I defend the class name of the album.

40
00:02:18,320 --> 00:02:21,680
I just simply name it as the album and it'll be just like the same.

41
00:02:21,680 --> 00:02:25,290
Our models slavery seemed to this modern slavery.

42
00:02:25,310 --> 00:02:28,970
I want to express our one of the inherited with our model class.

43
00:02:29,610 --> 00:02:31,340
I just simply defined as a model class.

44
00:02:31,670 --> 00:02:38,750
OK, and now for this one, I want to do want to define one of the field and this field name.

45
00:02:38,750 --> 00:02:41,090
I just simply defined that name as the artist.

46
00:02:42,150 --> 00:02:43,850
OK, just name it as the artist.

47
00:02:43,850 --> 00:02:49,970
And with this model models and with this model, I want to call the foreign key.

48
00:02:54,340 --> 00:02:58,870
OK, just name it as one of the foreign key, and I don't appreciate all of the foreign key of far out

49
00:02:58,870 --> 00:03:02,280
this musician will say, just simply defending it.

50
00:03:03,010 --> 00:03:04,960
And also here, I want to share that one.

51
00:03:04,960 --> 00:03:10,890
Things we do by default, when you actually ranie by default, this Jianguo automatically created the

52
00:03:10,900 --> 00:03:11,400
idea.

53
00:03:11,650 --> 00:03:15,440
So here you don't need to create it like here automatically.

54
00:03:15,490 --> 00:03:17,710
So be created one of the field as the idea.

55
00:03:17,710 --> 00:03:20,550
And for this idea it will be defined in the models.

56
00:03:21,240 --> 00:03:25,640
OK, that means with these models automatically it will be defined as auto implemented.

57
00:03:25,660 --> 00:03:31,780
That means the auto field, OK, auto field and also should be defined as the primary.

58
00:03:36,270 --> 00:03:45,630
Primary underscore key and also will be the true so automatically by default, this Jianguo automatically

59
00:03:45,630 --> 00:03:47,010
created this type of one of the.

60
00:03:47,460 --> 00:03:50,340
So that is actually by default, thinks the hair is hidden.

61
00:03:50,740 --> 00:03:53,700
So here, if you don't want to use it, then you don't need to use it.

62
00:03:53,730 --> 00:03:59,460
OK, so here automatically all the hidden in the field is created for a particular that.

63
00:03:59,460 --> 00:04:02,790
Jianguo So for the reasons here we don't need to defining it.

64
00:04:02,790 --> 00:04:05,300
So here I define as a foreign key into the foreign key.

65
00:04:05,310 --> 00:04:07,370
I want to create one of the foreign keys for our.

66
00:04:07,380 --> 00:04:13,950
This means that this mediation table so automatically it should be connected with this hidden I.D. So

67
00:04:13,950 --> 00:04:18,930
here I define as a musician and also I want to do and define the own dialect.

68
00:04:20,670 --> 00:04:23,790
OK, I simply dependence on the left and with these models.

69
00:04:25,020 --> 00:04:28,590
OK, so with these models, I want to define my weapons as a cascade.

70
00:04:30,570 --> 00:04:37,430
That means if any musician have any album in particular, that position if you want to, so you cannot

71
00:04:37,440 --> 00:04:38,930
elected directly for the reasons here.

72
00:04:38,940 --> 00:04:40,650
I just simply defined as a cascade.

73
00:04:40,860 --> 00:04:44,160
And also after that I want to do undertake another filename.

74
00:04:44,160 --> 00:04:47,070
So I just simply define that another filename will be as a name.

75
00:04:47,070 --> 00:04:52,380
And then with these models and with this model, I want to define the type as a characterful type

76
00:04:55,080 --> 00:04:56,010
character freaked out.

77
00:04:56,010 --> 00:05:02,820
And for this character will die by the simply defined the max maximum land sorry, maximum land I want

78
00:05:02,820 --> 00:05:04,250
to define for this one.

79
00:05:04,560 --> 00:05:10,430
That means the name as a one hundred character and also had to do under defined the field as a relisted

80
00:05:11,790 --> 00:05:12,370
release.

81
00:05:12,390 --> 00:05:15,260
Underscore dates of everything is step by step.

82
00:05:15,270 --> 00:05:17,130
Everything will be very much clear to you.

83
00:05:17,190 --> 00:05:19,080
OK, so don't worry about it.

84
00:05:19,200 --> 00:05:25,590
I just simply defendor another field as a release date and for the release date to have also another

85
00:05:25,590 --> 00:05:26,940
type as a data type.

86
00:05:27,240 --> 00:05:32,270
So everything is our in our model with this I just simply defined as a models into this models.

87
00:05:32,290 --> 00:05:34,680
I want to define another type as a type.

88
00:05:35,280 --> 00:05:43,140
I guess I just simply defined as a date field site to simply define the date field, OK, and also undertake

89
00:05:43,140 --> 00:05:44,360
another field for that.

90
00:05:44,410 --> 00:05:47,400
ARMBRISTER Such as simply defined as the no underscore.

91
00:05:47,400 --> 00:05:50,070
Ister OK, no it starts.

92
00:05:50,070 --> 00:05:56,610
And then with this model, with these models, I want to make the things as a desert field.

93
00:06:00,240 --> 00:06:03,780
OK, just name it as Intisar feel for this one, perfect.

94
00:06:03,800 --> 00:06:05,910
So here I have created two of this class.

95
00:06:05,940 --> 00:06:09,620
One is a musician class and for the musician class, they have the three feel.

96
00:06:09,630 --> 00:06:11,600
And also that is our middle class.

97
00:06:11,610 --> 00:06:13,290
I have defined as the album.

98
00:06:13,470 --> 00:06:16,410
And for this album I have defined that our forcefield.

99
00:06:16,410 --> 00:06:16,740
Right.

100
00:06:17,040 --> 00:06:18,570
So that will be our farfield.

101
00:06:18,690 --> 00:06:20,610
And also that will do it here.

102
00:06:20,610 --> 00:06:26,850
Also, they have all the follow on the hidden field where I want to add that things for you like here

103
00:06:26,850 --> 00:06:29,520
it will be also honored that he didn't feel as the idea.

104
00:06:29,730 --> 00:06:37,830
And then with these models that have all also one of the divers or Tuffield, OK, Autofill, and then

105
00:06:37,830 --> 00:06:39,090
you should be at the primary.

106
00:06:42,420 --> 00:06:46,540
So it will be the primary key and then you will be the truth.

107
00:06:48,030 --> 00:06:52,170
So he had this step up, one of the hidden field already added on here.

108
00:06:52,170 --> 00:06:55,350
So better had to do and to make the things that are not OK.

109
00:06:55,350 --> 00:07:01,260
So that is by default one of the things and also for this table, that means for this class also, there

110
00:07:01,260 --> 00:07:04,430
have also been other idee, in particular that area.

111
00:07:04,800 --> 00:07:07,070
So here you don't need to add this idea.

112
00:07:07,110 --> 00:07:10,170
If he didn't know the is automatically created.

113
00:07:10,170 --> 00:07:11,780
So you don't need to worry about it.

114
00:07:12,090 --> 00:07:14,430
And after that, we have to do we have to run three.

115
00:07:14,430 --> 00:07:14,920
Come on.

116
00:07:14,990 --> 00:07:20,220
OK, so now, first of all, I want to do and say, wait, so I just got to save all and on our project.

117
00:07:21,470 --> 00:07:24,200
So here I open our terminal into this terminal.

118
00:07:24,230 --> 00:07:26,690
So that is actually our in particular that position.

119
00:07:26,690 --> 00:07:28,140
So that is on my passport.

120
00:07:28,250 --> 00:07:28,500
Right.

121
00:07:28,790 --> 00:07:32,490
So now here you first of all, you have to make if you want to make the deal.

122
00:07:32,570 --> 00:07:38,510
They have also of the commanders, a python python man is with this man is.

123
00:07:38,900 --> 00:07:43,370
Everything we have to actually call it with our Manase fight scene with the Python and menace fight,

124
00:07:43,370 --> 00:07:50,930
then I want to do migrated to simply defined as a python menace fly and the market so no one to do and

125
00:07:50,930 --> 00:07:53,390
to make their destabilizing effect because they enter.

126
00:07:55,570 --> 00:08:00,310
So here they have solved the arrow is a class musician, so, you know, on line five.

127
00:08:00,490 --> 00:08:02,530
That is our unexpected indents.

128
00:08:02,570 --> 00:08:07,780
Maybe they have some spaces which I just removed that space.

129
00:08:08,700 --> 00:08:10,820
Also, I just hope that Espace.

130
00:08:10,860 --> 00:08:12,930
OK, and now let's check this out.

131
00:08:12,970 --> 00:08:15,630
Just click on the Save All I will say.

132
00:08:15,630 --> 00:08:16,410
Well again.

133
00:08:17,590 --> 00:08:23,270
And now that's all I want to do and actually run it again.

134
00:08:23,320 --> 00:08:29,260
OK, so I to run it again as a PSP banners start fight and my great Kilcunda and.

135
00:08:31,350 --> 00:08:38,460
Yes, now that have actually sound the you here, so now it's migrating all that file successfully and

136
00:08:38,460 --> 00:08:41,370
after that also you have to run our another course here.

137
00:08:41,370 --> 00:08:49,290
We have to run as a python python and then Manny's Manny's Dot Fye.

138
00:08:50,760 --> 00:08:52,450
And this man is Dumphy here.

139
00:08:52,470 --> 00:09:01,080
We had to make that our migration status simply defined as to make migration migrations sorry, I actually

140
00:09:01,080 --> 00:09:12,900
praised that and so defined as a python and then Manna's Lotfy and that make migration can migrations

141
00:09:12,900 --> 00:09:14,840
and then our name.

142
00:09:14,850 --> 00:09:16,170
That means our app name.

143
00:09:16,180 --> 00:09:19,440
So our app name is our first app here you can see.

144
00:09:19,510 --> 00:09:22,970
And I put some of this spelling mistake as a fast if I may.

145
00:09:23,340 --> 00:09:24,720
So now it's OK with me.

146
00:09:24,720 --> 00:09:26,940
So I want to do and to define our app name.

147
00:09:26,940 --> 00:09:32,250
So our name as a fast if I fsd underscore app.

148
00:09:33,060 --> 00:09:35,550
So here I have to define our application names.

149
00:09:35,550 --> 00:09:37,980
So that is a common python.

150
00:09:37,980 --> 00:09:43,410
Manase fly and make migration's ok, make migration's and then our fast app.

151
00:09:43,620 --> 00:09:45,090
So now I just click the enter.

152
00:09:46,810 --> 00:09:52,540
So now here you can see it's not created that model as a musician model and also created another model

153
00:09:52,540 --> 00:09:53,390
as the album.

154
00:09:53,980 --> 00:09:56,110
So here I have created two of this class.

155
00:09:56,140 --> 00:09:57,260
One is the musician.

156
00:09:57,280 --> 00:09:58,360
Another is the album.

157
00:09:58,370 --> 00:10:00,510
So it's not perfectly clear that to have this model.

158
00:10:00,880 --> 00:10:03,280
So after that, we have to do we have to run again.

159
00:10:03,280 --> 00:10:05,260
We have to migrate it again.

160
00:10:05,290 --> 00:10:15,130
So if you want to migrate with the same python python and the Manny's Manny's dog fight and then migrate,

161
00:10:16,240 --> 00:10:22,960
so are simply defined as a python managed Lotfy and a my good friend every time whatever that you Jameses

162
00:10:22,960 --> 00:10:24,700
in particular, that model Sadiya.

163
00:10:24,700 --> 00:10:28,090
Every time you have to run this record, one will be as a python.

164
00:10:28,270 --> 00:10:29,320
It's fired up like that.

165
00:10:29,540 --> 00:10:34,650
And after that, the python, Manase Fi and the migration's and then Fastweb.

166
00:10:34,720 --> 00:10:40,050
And after that again, you have to run that python minus Fi and the Meklit like a friend.

167
00:10:40,330 --> 00:10:44,430
So every time one of the things you will change in particular that position.

168
00:10:44,440 --> 00:10:49,480
So every time you have to run this trick or so now under do under the enter.

169
00:10:51,380 --> 00:10:53,810
So now everything is not perfectly OK.

170
00:10:54,370 --> 00:11:00,350
That means we successfully create our database and the database, we successfully created our tour of

171
00:11:00,350 --> 00:11:00,990
this model.

172
00:11:01,010 --> 00:11:04,780
So that is our bootable as a musician to be on the album table.

173
00:11:05,660 --> 00:11:11,210
So, you know, next video I want to do, I have already created to this model as a musician and the

174
00:11:11,210 --> 00:11:11,670
album.

175
00:11:11,830 --> 00:11:17,480
Now, if you want to insert some of the data in particular, that musician that feel that first name,

176
00:11:17,480 --> 00:11:23,240
the last name and the instrument field, so I can add this object into this table in our next video,

177
00:11:23,240 --> 00:11:25,330
I will show you that things with a live example.

178
00:11:25,790 --> 00:11:29,300
So thanks for watching and I'll see you in the next video.
