1
00:00:00,150 --> 00:00:05,610
Hello, friend will come back in a previous video, we have created some the class right here, we have

2
00:00:05,610 --> 00:00:10,720
created all the class as it user and also we have created the class as a mieux, our manager.

3
00:00:11,130 --> 00:00:16,710
So now I want to do for our e-commerce project that the user profile is so much important on the part

4
00:00:16,830 --> 00:00:18,450
and indeed the user profile here.

5
00:00:18,450 --> 00:00:21,730
I want to do want to define some of the multiple feel for our user.

6
00:00:22,050 --> 00:00:29,220
So for the business here, I wanted to create another class, OK, and want to create another class

7
00:00:29,220 --> 00:00:30,600
and I just name it as a profile.

8
00:00:31,800 --> 00:00:38,670
And if the profile, it will be integrated with our models, OK, with the models and it'll be also

9
00:00:38,670 --> 00:00:39,330
that model.

10
00:00:40,710 --> 00:00:45,750
OK, so then the model and also after that we have to we have to define our all the fields.

11
00:00:45,750 --> 00:00:48,060
So first of all here and order to define the user.

12
00:00:48,390 --> 00:00:51,950
And with this user here I want to define that will be as a model.

13
00:00:51,990 --> 00:00:53,870
This will be just like the same before here.

14
00:00:53,880 --> 00:00:56,880
I want to create one of the relation as a one to one Felician,

15
00:01:01,290 --> 00:01:02,790
OK, one to one relation.

16
00:01:02,850 --> 00:01:08,040
And with this one to unfilial relation here will be our user and the user.

17
00:01:08,040 --> 00:01:09,510
I want to define it on the left.

18
00:01:09,960 --> 00:01:10,900
On the left.

19
00:01:11,820 --> 00:01:17,000
So that will do is to be just like the same before we have already did the labor work all of the time.

20
00:01:17,370 --> 00:01:23,310
So on the lectures will be on the left with the models and then I want to make that as a cascade.

21
00:01:25,110 --> 00:01:27,480
And then I also want to define that one of the relation.

22
00:01:27,520 --> 00:01:34,670
So here I have to define the relation name with the related name, work related underscore name, and

23
00:01:34,670 --> 00:01:36,240
I just name that as a profile.

24
00:01:39,210 --> 00:01:45,360
OK, just name it as the profile and no one else wants to do and define some of the feel for this user

25
00:01:45,390 --> 00:01:46,220
as a user name.

26
00:01:46,560 --> 00:01:50,480
OK, username fill will be created with these models.

27
00:01:51,150 --> 00:01:54,310
So this model, it will be as a character filter.

28
00:01:57,030 --> 00:02:01,290
OK, so we have the character field and with this character we like to find one of the attributes of

29
00:02:01,290 --> 00:02:01,980
the maximum.

30
00:02:03,030 --> 00:02:05,520
So I just simply defend the maximum talent.

31
00:02:07,110 --> 00:02:09,900
Maximum length will be to 64.

32
00:02:10,050 --> 00:02:18,630
And also I want to do and make as a blank blank as a through and then also in order to undertake another

33
00:02:18,630 --> 00:02:22,630
one for our full name, again, this user full name.

34
00:02:22,770 --> 00:02:24,660
And here with these models.

35
00:02:25,630 --> 00:02:28,080
So this model and the different, the character field.

36
00:02:29,280 --> 00:02:34,950
So character feel also here I want to define what the maximum length, maximum length will be, the

37
00:02:34,950 --> 00:02:35,970
264.

38
00:02:36,450 --> 00:02:47,160
OK, and then also I want to make that as a blank blank will be added through and then also and we need

39
00:02:47,160 --> 00:02:49,700
that address because that is actually the e-commerce site.

40
00:02:49,710 --> 00:02:54,870
So for the e-commerce site, we need to know that there's a difference, that just one would be the

41
00:02:55,170 --> 00:02:55,900
models.

42
00:02:56,340 --> 00:03:03,900
So this model will be the TextField OK field, so it'll be the TextField.

43
00:03:03,900 --> 00:03:09,990
And for the text file, I want to define the maximum all of the attributes as the maximum limit to maximum

44
00:03:10,260 --> 00:03:11,130
for the text field.

45
00:03:11,130 --> 00:03:13,000
I want to define of the 300 character.

46
00:03:13,100 --> 00:03:16,530
OK, and also here I want to do and to make that blank.

47
00:03:18,480 --> 00:03:20,500
And black will be the true.

48
00:03:21,420 --> 00:03:26,760
And then also we need the city and city will be with these models.

49
00:03:27,870 --> 00:03:28,260
OK.

50
00:03:28,290 --> 00:03:28,810
Sorry.

51
00:03:30,840 --> 00:03:40,580
So this model, this will be also the character filled character field and then the maximum land mass

52
00:03:40,740 --> 00:03:41,760
for the city.

53
00:03:41,760 --> 00:03:44,670
I define the maximum length will be as 40 character.

54
00:03:45,090 --> 00:03:47,070
And I'll make that as a blank

55
00:03:50,310 --> 00:03:51,710
blank as a true.

56
00:03:53,550 --> 00:04:01,180
And then our another field I want to define as a zip code, OK, zip code with these models.

57
00:04:02,550 --> 00:04:07,170
So this models I want to do and do find that this will be also the character field.

58
00:04:08,060 --> 00:04:11,040
OK, sorry, CAGR character field.

59
00:04:11,610 --> 00:04:13,830
And then I define the maximum length.

60
00:04:14,550 --> 00:04:18,150
Maximum length will be four zip code.

61
00:04:18,150 --> 00:04:19,170
I define as a ten.

62
00:04:19,320 --> 00:04:26,100
OK then will be enough and I just simply defend the blank and blank will be the true.

63
00:04:28,670 --> 00:04:38,420
And then I define another one as a country country will be are the models then correct a field and then

64
00:04:38,420 --> 00:04:44,900
maximum length sorry, maximum playing for the country.

65
00:04:44,900 --> 00:04:48,620
I defended the 20 and make that blank.

66
00:04:50,180 --> 00:04:51,710
Blank is equal to true.

67
00:04:53,370 --> 00:04:54,830
OK, blank as were true.

68
00:04:55,280 --> 00:04:58,490
And also I don't want to take that our phone number.

69
00:04:58,980 --> 00:05:01,190
That means the phone with sorry.

70
00:05:01,760 --> 00:05:02,990
With the models.

71
00:05:04,070 --> 00:05:05,030
With the models.

72
00:05:05,030 --> 00:05:13,250
I want to find the character field character field and then maximum length and far form maximum length

73
00:05:13,250 --> 00:05:24,030
will be the 20 and also make as a blank like a blank will be as a true and then the date of joining.

74
00:05:24,050 --> 00:05:29,950
So I just simply give the date underscored giant dead giant.

75
00:05:29,950 --> 00:05:36,680
And here with these models, with this model, this will be a table where the date time field.

76
00:05:40,880 --> 00:05:50,720
The time feels right so that it will be the day time field and then it will be as an auto auto now and

77
00:05:53,210 --> 00:05:57,220
underscore at and then it shall be true.

78
00:05:57,830 --> 00:06:00,220
And after that, I want to do the function.

79
00:06:00,230 --> 00:06:09,590
So here I want to do and the final days of this to function as a day of the double and the line is train

80
00:06:10,640 --> 00:06:12,680
and here will be the self.

81
00:06:13,850 --> 00:06:19,970
And then here I want to do in order to find the return route and our user name with the self.

82
00:06:20,660 --> 00:06:24,830
I defended the user name, OK, and use user name after that user name.

83
00:06:24,830 --> 00:06:29,090
I want to define who shall be displayed as a user name is profile.

84
00:06:29,120 --> 00:06:32,490
OK, so here after that user name I want to define it.

85
00:06:32,510 --> 00:06:35,660
Plus it shall be ad as opposed to.

86
00:06:36,560 --> 00:06:44,380
OK, so here it is with this type of one of the picks that in the profile that means if you define as

87
00:06:44,390 --> 00:06:47,060
the audience then it should be defined as the audience profile.

88
00:06:47,210 --> 00:06:53,480
OK, so this step up of the Texas will be added after this user name and then on want one to define

89
00:06:53,480 --> 00:06:57,740
another functionality because first of all, here we have to do have to check all that our field.

90
00:06:57,740 --> 00:06:58,010
Right.

91
00:06:58,340 --> 00:07:02,880
So here, if you want to check that field, then also you have to have a different function.

92
00:07:03,260 --> 00:07:09,320
So here I want to create all the function and I just name each of these underscore for field.

93
00:07:10,130 --> 00:07:15,540
OK, so here I want to do first of all, check that field is already fully fulfilled or not.

94
00:07:15,950 --> 00:07:19,330
So here I take one of the function name, whatever the name you are choosing.

95
00:07:19,340 --> 00:07:21,240
So that is actually customized function.

96
00:07:21,300 --> 00:07:26,360
So now I want to create this function with the self and here with the self.

97
00:07:26,360 --> 00:07:28,910
So I take on the variable as a field name.

98
00:07:30,270 --> 00:07:32,030
OK, fields under a name.

99
00:07:32,030 --> 00:07:34,760
I just take one of the variables with this variable.

100
00:07:34,760 --> 00:07:36,730
I want to first of all, check all that our field.

101
00:07:37,100 --> 00:07:45,680
So if you want to check if such a simple defined field and the name and therefore if sorry if in the

102
00:07:45,680 --> 00:07:53,810
self so the self you have to define that underscore metal a metal with this metal you have to get your

103
00:07:54,170 --> 00:07:54,680
filename.

104
00:07:54,770 --> 00:07:57,470
So here I just simply want to get all that feel.

105
00:07:57,590 --> 00:07:59,240
That is a good underscore field.

106
00:08:00,350 --> 00:08:00,970
OK, field.

107
00:08:01,030 --> 00:08:02,620
So here you have to defining it.

108
00:08:02,630 --> 00:08:04,270
So that is also not the building function.

109
00:08:04,730 --> 00:08:06,410
So I just take a picture.

110
00:08:06,410 --> 00:08:11,990
First of all, check all the tower profile field and I just take that all field with this variable.

111
00:08:11,990 --> 00:08:16,880
That means that this variable so no one to do and to check this condition, if this field is already

112
00:08:16,880 --> 00:08:21,200
filled up, then it should be shown as a true then it should be sure as a false.

113
00:08:21,270 --> 00:08:23,060
OK, see here after this.

114
00:08:23,300 --> 00:08:26,870
So after this I wanted to undertake I wanted the for loop.

115
00:08:26,870 --> 00:08:34,970
So just simply to follow and follow up here, I want to define that name as a field field and rescan

116
00:08:34,970 --> 00:08:37,160
name in fields.

117
00:08:39,790 --> 00:08:45,190
OK, feels under its own name because of all here, I have already get all that our check that is here,

118
00:08:45,190 --> 00:08:49,960
I already check all that feed and take the things with this variable to note here, I just ran all the

119
00:08:49,960 --> 00:08:51,430
for up for the follow.

120
00:08:51,460 --> 00:08:54,250
The reader feels I just name it with feeling them.

121
00:08:54,520 --> 00:08:56,870
So with this feeling them, I want to do want to check it.

122
00:08:56,890 --> 00:08:57,170
OK.

123
00:08:57,190 --> 00:09:00,190
So here I want to do want to check every field.

124
00:09:00,550 --> 00:09:06,210
So here after this I find that value so into the value area.

125
00:09:06,220 --> 00:09:09,900
I want to define of another function as a great attribute.

126
00:09:09,910 --> 00:09:14,620
So I just simply defines a good attribute with this great attribute.

127
00:09:14,620 --> 00:09:18,620
It should be the self and then our this name.

128
00:09:18,640 --> 00:09:21,710
That means our field names are just simply defined the film.

129
00:09:22,120 --> 00:09:26,370
And if that is if our this value is not known.

130
00:09:27,610 --> 00:09:29,920
So the value is not.

131
00:09:30,430 --> 00:09:37,180
So here I define the non are value value equally empty.

132
00:09:37,750 --> 00:09:46,220
OK, so then it shall be done return as a false false and then it shall be returned to our true.

133
00:09:46,270 --> 00:09:48,220
OK, so just simply improve and return.

134
00:09:48,730 --> 00:09:49,080
True.

135
00:09:49,540 --> 00:09:55,900
And now after that we have to do we have to define this step up of the things like when our this user

136
00:09:55,900 --> 00:09:58,840
will be created automatically will be created.

137
00:09:58,840 --> 00:10:00,880
Another object for our D profile.

138
00:10:00,990 --> 00:10:06,820
OK, that means here that all the profiles automatically when this user will be created our D profile,

139
00:10:07,090 --> 00:10:08,690
all the file will be created.

140
00:10:08,950 --> 00:10:14,480
So if you want to do that work, then there have also solved the class we have to import.

141
00:10:14,950 --> 00:10:16,600
So after this here.

142
00:10:16,600 --> 00:10:18,880
But I want to read some of the comments for you.

143
00:10:19,300 --> 00:10:19,540
OK.

144
00:10:19,580 --> 00:10:20,610
So here I define defended.

145
00:10:20,650 --> 00:10:22,780
It should be either to automatically.

146
00:10:26,040 --> 00:10:29,490
Create one to one object.

147
00:10:31,290 --> 00:10:33,520
OK, so it'll be paid on to an object.

148
00:10:33,750 --> 00:10:36,910
So for now, we're going to, of course, forget it.

149
00:10:36,930 --> 00:10:44,890
So from our Django, from the Django DBI and then models.

150
00:10:45,460 --> 00:10:52,050
So from here, there is also the another one as a single model.

151
00:10:52,050 --> 00:10:57,930
And then also the other one of the signals with the signals here.

152
00:10:58,090 --> 00:11:02,280
I don't want to import our post underscore safe.

153
00:11:02,290 --> 00:11:04,630
So that is of that object function.

154
00:11:04,950 --> 00:11:06,500
So here you have to take it.

155
00:11:06,510 --> 00:11:12,300
And also from Django, from Django.

156
00:11:12,480 --> 00:11:17,700
There is also another one of the dispatch, S.H. Dispatch.

157
00:11:17,700 --> 00:11:19,140
Right, dispatch.

158
00:11:19,140 --> 00:11:20,300
But this is perfect.

159
00:11:20,550 --> 00:11:24,260
So do the dispatch down to also import the receiver.

160
00:11:26,970 --> 00:11:30,420
So just simply add I import our receiver.

161
00:11:30,660 --> 00:11:32,240
So now with this receivers.

162
00:11:32,280 --> 00:11:35,020
OK, so this is where we have to defining it.

163
00:11:35,040 --> 00:11:40,590
So after this here, first of all, we have to define our DDC words.

164
00:11:40,920 --> 00:11:46,540
So with these receivers, first of all, I want to do when this user is already said this data, then

165
00:11:46,540 --> 00:11:48,160
it should be sense of the signal.

166
00:11:48,180 --> 00:11:54,510
OK, so here with this post, that is with this post save, we can send this information so there is

167
00:11:54,510 --> 00:11:55,260
a sender.

168
00:11:55,590 --> 00:11:57,350
So the sender will be able to use it.

169
00:11:57,360 --> 00:11:57,630
Right.

170
00:11:57,870 --> 00:12:03,720
So when this end user will be created, the initial Besançon, the request or some of the message that

171
00:12:03,720 --> 00:12:05,260
he created one of the user.

172
00:12:05,520 --> 00:12:14,730
So when this user will be created, then I want to do the function as a create profile, create a profile

173
00:12:14,730 --> 00:12:21,630
that means in this user saying that information that the user is created then our function.

174
00:12:21,660 --> 00:12:24,330
That means our D profile function will be activated.

175
00:12:24,390 --> 00:12:26,780
OK, so you do this profile function here.

176
00:12:26,790 --> 00:12:28,680
We have to do have to pass that sender.

177
00:12:29,640 --> 00:12:31,830
And then also we have to define that.

178
00:12:31,830 --> 00:12:39,360
In a sense that means our instant and also now it will be created our profile.

179
00:12:39,390 --> 00:12:44,670
So here I have to do that well-defined, that created OK, the same paths that created.

180
00:12:44,670 --> 00:12:47,630
And also here we have to pass our key argument.

181
00:12:47,640 --> 00:12:52,450
So here defined as the key argument, OK, argument.

182
00:12:52,890 --> 00:12:56,900
And now I have to do I have to define our the condition.

183
00:12:56,910 --> 00:12:57,930
I just simply leave.

184
00:12:57,930 --> 00:12:59,460
This user is created.

185
00:13:00,210 --> 00:13:05,540
OK, that means if this is actually the created, then it shall be created one of the profile objects.

186
00:13:05,550 --> 00:13:08,090
So here I define that profile.

187
00:13:09,990 --> 00:13:13,710
So there is a profile that means I have already defined our class.

188
00:13:13,710 --> 00:13:14,970
That is our profile class.

189
00:13:15,060 --> 00:13:18,120
That means our profile object that I have already created.

190
00:13:18,610 --> 00:13:20,870
So that is our profile.

191
00:13:23,550 --> 00:13:24,890
So that is our profile, right?

192
00:13:25,180 --> 00:13:29,660
So the profile you should be now getting, that data, that is all that objects are here.

193
00:13:29,670 --> 00:13:36,240
I just simply defining the profile and with this profile objects, OK, with these objects.

194
00:13:36,240 --> 00:13:39,920
And here we have to define that create, then create.

195
00:13:39,930 --> 00:13:42,100
And here we have to parse out how to use a.

196
00:13:42,990 --> 00:13:47,100
So I just simply pass our user in a stance, OK, user instance.

197
00:13:47,550 --> 00:13:54,900
And also here when this will be done then I don't want to define our save all the data into the profile

198
00:13:54,900 --> 00:13:55,330
area.

199
00:13:55,800 --> 00:14:01,890
So I think you will understand about it so that we saw in our this there will be created then automatically

200
00:14:01,890 --> 00:14:07,290
if we send this request and then our D create profile function will be activated.

201
00:14:07,510 --> 00:14:12,990
And also here I have to do I have to define another one so bitter I want to do a hundred different and

202
00:14:12,990 --> 00:14:13,940
other function.

203
00:14:13,950 --> 00:14:19,920
So here when this user will be send that request, I also want to do I want to pass out this all the

204
00:14:19,930 --> 00:14:20,870
Tiensten data.

205
00:14:20,880 --> 00:14:26,760
So here that is also all that fear will be activated and into this field area that we see in our profile

206
00:14:26,760 --> 00:14:27,160
area.

207
00:14:27,160 --> 00:14:28,960
I want to add all that, our field.

208
00:14:28,980 --> 00:14:34,230
OK, so here, if you want to add it, then you have to define the function and just name it as a safe

209
00:14:34,830 --> 00:14:36,330
that can save this profile.

210
00:14:38,730 --> 00:14:41,520
OK, just symbol in front of the profile of the function.

211
00:14:41,520 --> 00:14:43,710
And here also we have to parse that sender.

212
00:14:44,100 --> 00:14:45,800
We have to parse that in a sense.

213
00:14:46,320 --> 00:14:49,470
And here also we have to parse out our key argument.

214
00:14:49,920 --> 00:14:52,340
So just simply define our key argument.

215
00:14:52,830 --> 00:14:58,610
OK, so key arguments and now we have to do we have to now save this data.

216
00:14:58,620 --> 00:15:00,420
So here at the front of the instance.

217
00:15:01,710 --> 00:15:09,570
So with this in Austin, I want to define our this here, I define that user right into this user area,

218
00:15:09,580 --> 00:15:10,980
we have to save all the data.

219
00:15:11,010 --> 00:15:14,110
So he defined that name as a related name with the profile.

220
00:15:14,730 --> 00:15:20,470
So here with this in a stand, you have to parse the profile and this profile, the time to save.

221
00:15:20,530 --> 00:15:22,240
So here I just simply say it.

222
00:15:22,530 --> 00:15:24,400
So that's all we have to do.

223
00:15:24,420 --> 00:15:27,260
So here I have created some of the class.

224
00:15:27,270 --> 00:15:28,680
So that is a profile class.

225
00:15:28,680 --> 00:15:33,840
I have played around in that class as a user and also that is our might user manager.

226
00:15:34,290 --> 00:15:37,840
So now we are ready to migrate to before migrated.

227
00:15:37,860 --> 00:15:41,550
We have to do we have to register all that our class in our admin.

228
00:15:41,550 --> 00:15:41,850
Right.

229
00:15:42,240 --> 00:15:47,700
So better able to do and to continue this process, you know, next video will register all the class

230
00:15:47,700 --> 00:15:50,470
in our admin and after that will make it OK.

231
00:15:50,490 --> 00:15:53,220
So we will migrate and access our admin.

232
00:15:53,220 --> 00:15:56,980
Then every functionality will be very much to you.

233
00:15:57,210 --> 00:16:00,480
So thanks for watching and I'll see you in the next video.
