1
00:00:00,210 --> 00:00:01,740
Hello, friend, welcome back.

2
00:00:02,130 --> 00:00:08,160
In a previous video, we successfully had to have this one is our username and there is our description.

3
00:00:08,160 --> 00:00:08,480
Right.

4
00:00:08,730 --> 00:00:14,520
And also we have updated our profile from here, if you update and then it to be redirected to our profile

5
00:00:14,520 --> 00:00:14,900
piece.

6
00:00:15,090 --> 00:00:17,640
So now I want to do I want to work with our post.

7
00:00:17,640 --> 00:00:23,760
That means this user, if this user want to add some of the post, how can add this post in this video?

8
00:00:23,770 --> 00:00:26,100
I will show that things with a live example.

9
00:00:26,550 --> 00:00:29,340
So for adding this post, if you like.

10
00:00:29,340 --> 00:00:31,500
No, I'd remove everything, OK?

11
00:00:31,530 --> 00:00:36,270
I remove everything so that we don't need this any more bit.

12
00:00:36,270 --> 00:00:37,830
And also I remove it.

13
00:00:38,250 --> 00:00:43,470
Like if you go to a post into the post area, if you go to our model.

14
00:00:43,800 --> 00:00:50,070
So for the post I have already declared all that our fields, our main field will be as emails and another

15
00:00:50,070 --> 00:00:51,330
will be as a caption.

16
00:00:51,630 --> 00:00:51,990
Right.

17
00:00:52,290 --> 00:00:58,350
That means this user can post with our two of these filled up in this user can post some of the images

18
00:00:58,350 --> 00:00:59,250
with the caption.

19
00:00:59,460 --> 00:00:59,880
Right.

20
00:00:59,890 --> 00:01:03,840
It will be just like our Instagram Cittadini Instagram.

21
00:01:03,840 --> 00:01:05,430
You post some of the images, right.

22
00:01:05,430 --> 00:01:07,560
So it'll be just like that same.

23
00:01:07,950 --> 00:01:09,570
So here if you want to post it.

24
00:01:09,570 --> 00:01:13,110
First of all, we have to create some of the form right across from one of the form.

25
00:01:13,110 --> 00:01:16,260
We have to insert this our emails and the caption.

26
00:01:16,380 --> 00:01:20,410
So if you want to do that work, then you have to do we have to create one of the forms right.

27
00:01:20,440 --> 00:01:23,310
So opposed scene to the posterior.

28
00:01:23,310 --> 00:01:25,230
I want to create one of the custom form.

29
00:01:25,620 --> 00:01:31,950
I will open all the new file and I just name it as a format, OK, which will be as a form swordfight

30
00:01:32,430 --> 00:01:33,630
soula the forms that file.

31
00:01:33,660 --> 00:01:36,360
First of all, we have to load our Django form.

32
00:01:36,390 --> 00:01:43,320
That means from that is in our Django and then from here I want to import our default class as a form

33
00:01:43,950 --> 00:01:44,430
sorry.

34
00:01:44,700 --> 00:01:45,870
That will be as a form.

35
00:01:46,110 --> 00:01:46,530
Right.

36
00:01:46,530 --> 00:01:48,240
So first of all, we have to load it.

37
00:01:48,570 --> 00:01:54,630
And also I want to do want to get all that our data from our model that is from model and text as our

38
00:01:54,630 --> 00:01:56,310
emails and the caption field.

39
00:01:56,550 --> 00:01:59,210
So if you want to access it, first of all, you have to do have to load it.

40
00:01:59,220 --> 00:02:01,830
So that is in our post and that is our models.

41
00:02:02,370 --> 00:02:08,400
So now to do and load that is from our from our app underscore post.

42
00:02:08,880 --> 00:02:12,930
That will be our post right from our app folder here.

43
00:02:12,930 --> 00:02:20,400
I want to do our to get our models and from here on to import our post that means sorry, that is our

44
00:02:20,400 --> 00:02:20,700
post.

45
00:02:20,700 --> 00:02:27,630
Plus so from our model, I have already created our class as opposed to now I import our post class.

46
00:02:28,050 --> 00:02:33,210
So now to do and to create the class for our form, I want to create the custom form I named as a class

47
00:02:33,810 --> 00:02:37,590
so class and I named that our form name will be as a post form.

48
00:02:37,860 --> 00:02:39,990
OK, that will be as a post form.

49
00:02:40,170 --> 00:02:46,740
So that will be as a post from a name ID as a post and it will be inherited our forms sorry, it should

50
00:02:46,740 --> 00:02:49,200
be noted our forms and then our model form.

51
00:02:49,890 --> 00:02:51,360
That means the model form.

52
00:02:51,540 --> 00:02:51,990
Right.

53
00:02:51,990 --> 00:02:58,590
It should be in our model from perfect and then I want to do I want to add or all that feel.

54
00:02:58,600 --> 00:03:01,500
So you going to get that field back without class.

55
00:03:02,430 --> 00:03:08,400
So class will be as a middle class and the middle class area with this model, I want to go on to access

56
00:03:08,400 --> 00:03:09,150
our model.

57
00:03:09,150 --> 00:03:10,680
I want to access our post model.

58
00:03:11,370 --> 00:03:14,430
So I have already loaded in put out this post model.

59
00:03:14,430 --> 00:03:14,700
Right.

60
00:03:15,120 --> 00:03:18,510
So that is our models and that is our table name as a post.

61
00:03:18,840 --> 00:03:24,330
No, I already load out this class and here our model will be our poster from our post model.

62
00:03:24,540 --> 00:03:26,910
I want to do I want to get all that our feel.

63
00:03:27,330 --> 00:03:29,520
So here I name it our field.

64
00:03:30,630 --> 00:03:34,020
OK, that means our fields, our fields will be right.

65
00:03:34,020 --> 00:03:37,770
No one to want to get our two of this field.

66
00:03:37,780 --> 00:03:40,290
I want to get our immense field, OK?

67
00:03:40,290 --> 00:03:46,590
I want to get out in this field and also I want to get out another field as there should be as a caption.

68
00:03:46,860 --> 00:03:50,610
OK, so from here I want to do I want to get out of this.

69
00:03:51,030 --> 00:03:52,500
So I load our model.

70
00:03:52,500 --> 00:03:58,140
So from our post model that is our fields, from our post model, I want to get our image field and

71
00:03:58,140 --> 00:04:01,980
the caption field reckford I hope is very much clear to you.

72
00:04:02,220 --> 00:04:08,250
So now I want to do I want to work in our view, that means, you know, ah, if you go to our app logging

73
00:04:08,850 --> 00:04:12,390
into the app logging, if you go to our view so into the view area.

74
00:04:13,080 --> 00:04:14,370
So that is our profile.

75
00:04:14,370 --> 00:04:14,580
Right.

76
00:04:14,580 --> 00:04:15,630
So into the profile area.

77
00:04:15,630 --> 00:04:16,460
I want to load it.

78
00:04:16,460 --> 00:04:19,410
So if you want to load it, first of all, you have to do we have to import it.

79
00:04:19,410 --> 00:04:24,120
That means you have to put out this both opposed and that is our form.

80
00:04:24,600 --> 00:04:26,430
So now I to do and to import it.

81
00:04:27,000 --> 00:04:34,110
So here that is from from our post and from our post, I load our forms.

82
00:04:34,560 --> 00:04:42,210
I have created one of the file as a forms and then I want to import and import our that means our apples

83
00:04:42,210 --> 00:04:43,350
and that is our forms.

84
00:04:43,350 --> 00:04:46,320
And from here I have created on the class of the post form.

85
00:04:46,320 --> 00:04:51,170
So now to do and load it, that means I want to load our post from right field.

86
00:04:51,300 --> 00:04:56,890
So with this class we can access, with this class we can access our two of these fields.

87
00:04:56,940 --> 00:04:59,910
That is our image field and the caption Filaret so.

88
00:05:00,260 --> 00:05:05,660
I want to turn to load our this form, so shall we be just like that, same before like that is our

89
00:05:05,660 --> 00:05:06,140
users.

90
00:05:06,910 --> 00:05:08,390
Here, here.

91
00:05:08,390 --> 00:05:10,510
But I don't want to put that condition.

92
00:05:10,880 --> 00:05:15,110
I want to put on the form that means which will be as a form.

93
00:05:15,830 --> 00:05:17,180
OK, it's always a form.

94
00:05:17,180 --> 00:05:19,340
And with this form, that will be our post.

95
00:05:19,640 --> 00:05:20,780
That is our post from.

96
00:05:20,780 --> 00:05:21,060
Right.

97
00:05:21,080 --> 00:05:22,670
I have already included.

98
00:05:22,670 --> 00:05:24,940
That means I have already improved our post from.

99
00:05:25,460 --> 00:05:27,320
So now I loaded that piece.

100
00:05:27,320 --> 00:05:33,560
I load our form and then I want to put that same condition that our request and request will be as a

101
00:05:33,560 --> 00:05:35,200
matter right.

102
00:05:35,210 --> 00:05:38,150
It will be checked that method as a post or not.

103
00:05:38,750 --> 00:05:39,830
So shall we check it?

104
00:05:39,830 --> 00:05:42,920
Because I want to load it some of the specific base.

105
00:05:42,920 --> 00:05:44,300
So that will be our post.

106
00:05:44,300 --> 00:05:46,700
And also after that, I take our form.

107
00:05:47,000 --> 00:05:52,370
That means our form will be without this post from right.

108
00:05:52,400 --> 00:05:54,280
That means our this post form.

109
00:05:54,290 --> 00:05:57,560
So with this fourth form, we have to pass our request.

110
00:05:58,070 --> 00:06:01,580
That means our request and then request will be as a post.

111
00:06:01,580 --> 00:06:01,880
Right.

112
00:06:02,120 --> 00:06:06,760
And also here I want to do and to work with our images.

113
00:06:06,770 --> 00:06:07,620
That means the image.

114
00:06:07,650 --> 00:06:12,650
So if you want to work with the images, as I told you before, here also we have to pass that our file

115
00:06:12,650 --> 00:06:13,130
request.

116
00:06:13,130 --> 00:06:13,380
Right.

117
00:06:14,000 --> 00:06:18,980
So now I also want to do I want to pass our request or request will be as a files.

118
00:06:20,720 --> 00:06:22,580
So request will be other files.

119
00:06:22,880 --> 00:06:24,350
And then I want to check it.

120
00:06:24,390 --> 00:06:33,680
That means if our form if our form is valid is underscore sorry, underscore valid.

121
00:06:33,690 --> 00:06:39,350
So I want to check it if it's valid and then I don't want to first of all, check it like I take one

122
00:06:39,350 --> 00:06:40,820
of the variable as a post.

123
00:06:40,820 --> 00:06:44,210
And then we thought this form data, I save it.

124
00:06:44,210 --> 00:06:50,270
And first of all, I don't want to make as a comet like a comet and we don't want to make it as a false

125
00:06:51,620 --> 00:06:52,070
comet.

126
00:06:52,070 --> 00:06:53,630
I want to make it as a false y.

127
00:06:53,630 --> 00:06:57,440
I'm actually make it as a false because of all here we have to do we have to check it.

128
00:06:57,440 --> 00:07:01,860
That means this user actually right now I'm already logging the Karzai.

129
00:07:01,910 --> 00:07:02,170
Right.

130
00:07:02,180 --> 00:07:03,840
So we have to do have to check it.

131
00:07:03,890 --> 00:07:08,150
This user is appropriately our disk, this current user or not.

132
00:07:08,450 --> 00:07:10,400
So here we have to do we have to check it.

133
00:07:10,400 --> 00:07:13,250
So if we want to check it, it's pretty simple here.

134
00:07:13,250 --> 00:07:18,830
We have to do if you go to our model, that means into the model area, you can see that is a clever

135
00:07:18,830 --> 00:07:19,670
auto rights.

136
00:07:19,670 --> 00:07:20,780
We have to check it out.

137
00:07:20,780 --> 00:07:23,720
This auto is our current user unknot.

138
00:07:24,080 --> 00:07:25,370
See, that is our authority.

139
00:07:25,640 --> 00:07:27,830
If you want to access it, that is our name.

140
00:07:27,830 --> 00:07:31,670
The relation with the posts with this post takes us out this author.

141
00:07:32,700 --> 00:07:37,330
So with this post I want to do on Texas, our this author.

142
00:07:37,860 --> 00:07:43,290
OK, I want Texas or this author and then I want to do it shall be Matute already to that.

143
00:07:43,300 --> 00:07:48,220
That means our logging user, which users don't currently logging.

144
00:07:48,240 --> 00:07:49,950
So that is our current user.

145
00:07:50,040 --> 00:07:50,400
Right.

146
00:07:50,700 --> 00:07:56,790
When our post our third and our current user will be equal, that means after that I don't want to save

147
00:07:56,790 --> 00:07:57,370
this data.

148
00:07:57,390 --> 00:08:03,720
So with this post I want to do and to save it, I hope is very much clear to your friend what exactly

149
00:08:03,720 --> 00:08:05,480
the things I did on here.

150
00:08:05,640 --> 00:08:11,880
So when this data will be saved after that, I wanted to return that we sound written with our SCDP

151
00:08:11,880 --> 00:08:12,540
response.

152
00:08:12,900 --> 00:08:19,050
That means when this user will be as safe our post, then it should be left to our better able to predict

153
00:08:19,050 --> 00:08:20,090
it to our home base.

154
00:08:20,580 --> 00:08:25,630
That means we the reverse and with a diverse area here and to do in the past our home.

155
00:08:25,990 --> 00:08:30,950
So for the home I have already created that you are that this is our main project.

156
00:08:30,960 --> 00:08:33,790
If we go to our main project, you are still here.

157
00:08:33,790 --> 00:08:35,250
You can see that is our home.

158
00:08:35,250 --> 00:08:36,870
You all I name it as a home.

159
00:08:37,090 --> 00:08:38,940
I want to do want to pass it from here.

160
00:08:38,940 --> 00:08:40,550
You can see they have no app name.

161
00:08:40,740 --> 00:08:46,390
So for the reasons you can directly access our list name to no one to do and to access our list, you

162
00:08:46,410 --> 00:08:48,150
should be directed to our home base.

163
00:08:48,510 --> 00:08:49,950
So that is our form.

164
00:08:49,960 --> 00:08:52,230
So now we have to do we have to pass this form, right.

165
00:08:52,230 --> 00:08:57,540
We have to pass this form in our user dot is causing delays, is a little visible.

166
00:08:58,020 --> 00:09:00,720
So better here after this.

167
00:09:00,720 --> 00:09:01,530
OK, after this.

168
00:09:01,530 --> 00:09:04,740
I want to deposit that within the parcel form.

169
00:09:04,740 --> 00:09:12,750
Sorry it be as a single code that we form, I pass our form so now we can actually access our this form

170
00:09:12,750 --> 00:09:13,950
in our user tortas.

171
00:09:13,950 --> 00:09:15,470
Tamalpais Redfearn.

172
00:09:15,840 --> 00:09:17,490
So that is our template.

173
00:09:17,490 --> 00:09:22,020
That means in our app logging app logging and then that is our user dollars.

174
00:09:22,410 --> 00:09:25,680
So that is the user datastream malaria here.

175
00:09:25,680 --> 00:09:27,630
I want to do and the visible our form.

176
00:09:27,900 --> 00:09:29,400
So how can do this work.

177
00:09:29,400 --> 00:09:31,170
But I want to continue this process.

178
00:09:31,170 --> 00:09:34,380
In our next video, I will show you that things with a live example.

179
00:09:34,830 --> 00:09:38,160
So thanks for watching and I'll see you in the next video.
