Hello, friend.
Welcome back.
In a previous video, we successfully complete our blog details, Paysite Click.
I read more than to be addicted to our blog Digital Space.
So now in this video on to discuss about how can add on to the comment option for a specific this blog.
So for doing this, we have to do we have to work in our blog detail space and for the blog details.
We have already created one of the method, Leprince, in our blog that we said in our blog into The
View area, that is a function name as a blog details.
So before I simply get all the DOT object data and here I pass it with our addiction to our blog details,
e-mail.
So right now, also here, we have to do have to pass one of the.
So here they have no such a building form.
So right now we have to do we have to create the custom form.
Right.
So if you want to create some of the custom forms, then what exactly you have to do?
I think you already know about it.
So right now, like here, I don't need this.
I remove everything from here.
And that is our blog also here.
Don't need this suffocating that all of the custom from here in our blog.
I wanted to create all the new file and just name it as a forms Lotfy.
That will be our custom form.
So here I want to do that to create on the custom form and then we will load our this form in particular
in this little space.
Right.
So don't worry, step by step I will show you everything with the live example.
So for doing this, first of all here we have to do we have to load our Django building form.
So that is from, that is from the Django.
So from the Django and from here, I want to import one of the building of the form, that is the forms.
So that is all Django building forms.
So now I want to do also I want to get all the dart glass that means in our model if you go to that
model.
So from the model, I need our block because of all either the logorrhea that have all the other block
details.
And also I need our this comment.
So if you want to get it, first of all, here, I want to do put it.
So that is from and app block.
So you can also make the things with our dot rather than if you want to put that your full name as app
block and from the app block that is a model.
So that is a clear model.
So from the Model S, we want to input our both of this class.
That means you our blog and that is our models.
Those are from the model I want to do to get our blog.
That is a block plus.
And also I want to do want to get our another class as a comment.
So into the common area here.
I have already cleared the field for the comment.
So now I only need it for the reasons here.
I simply add our this class as a common class of a friend I hope is very much clear to you.
So now to do and to create one of the class.
Now I name it as a class and I name it as a comment.
OK, name it as a comment from then.
It's sort of a better side name it is coming from.
So we inherited our Django forms, so that is our Django forms.
And then also it would be in our model form that will be as a model form.
Right.
So I loaded it.
So in fundamental, I have already discussed about the things we use right now to create another custom
model.
And then here I name it, one of the class that into the class area.
I want to create another class.
That means you will be as a middle class.
Right?
So I named it as a class and it will be as a matter that will be as a middle class and into the middle
class area.
First of all, I want to load our model, so I want to load that model.
That means which model to load out, load our common model and form to the common model I want to do
and to get our disgorgement field.
That means this field will be needed.
Right.
So now after that here I will add our fields so our fields, our fields will be I want to do and the
visible our common field.
Right.
I hope is very much clear to you.
So that will be our common form.
So now we have to do we have to load it.
We have to load it out.
This class, in our view, that means in our blog details.
Right.
So here now we have to work.
So after that, I take one of the variable and I just name it as a common form.
OK, comment underscored form.
So it will be on the common from and here we have to do we have to load our D.
That means that is our common form.
So I copy and here I load it.
So if you want to access it, that means if you want to access our this class, first of all here in
our mind here, we have to first of all, load it right so now and want to import it.
So that is from our from and then our app that means from our blog and then the frumps from from the.
From sound to import our last name.
That will be our comment from right so here, first of all, like the chili imported and now we can
actually access it.
So here I access it.
I take that things with this variable and then Orest, all that step will be just like the same before
or more know if you want to load on the form.
So what exactly we did first of all, I add one of the if condition and then we have to parse that request.
Right.
Request methode.
That means one of the things will pass from our blog.
Details that into the block.
Details here.
We have to add on the form.
So here from here we have to parse that.
Our request method, that request method.
First of all, I want to check it.
I want to check it is both method, the gate method.
First of all, we have to check it.
Right.
And then I want to do I want to pass our district post.
That means I take that word things with this variable as a comment.
So shall we just like the same before?
I hope you remember that.
But that means the comment that our class class will be as a comment, and that means in our comment
form and the common form here, we have to pass our distinguished post.
Right.
So it will be as a request and then post.
So here we have to pass it.
And after that I have to do I have to check it.
That means I have to check that is valid.
So with the if condition, sorry, with the if condition and then without this comment that we see with,
without this comment from because of all here, I take the things with this variable before we use it
as the only form.
Right.
So not changed for the comment from and if our this comment from a so I wanted to check it is valid
is underscore valid.
So is valid.
I want to check it.
So if I then I want to do I want to actually save it.
So I take of the variable as a comment I take on the variable of the comment and now with this comment
form.
So with this comment from I want to do and to save it, I want to save it.
So here first of all, also we have to check it.
We have to check it.
Which user actually put that comment and which blog post actually put that comment?
Right.
So for the resource here, if you go to our model into the model area, I have already declared both
of this at, that will be our blog.
And here I make our forint key with our block class and then also the user.
And that is our foreign key with our user class.
That means which user actually pulled that comment and in particular, which blog post this user put
that comment.
So here also we have to declare both of these.
So for the reasons here, I want to do before.
First of all, I want to make as a comet, as a false comet.
I want to learn to make that as a first of all, it will be the false right.
That means I want to pending this data and then here we have to do have to check it.
So with this comment, so with this comment I want to do on to access our user, that means here, here,
that will be our user.
And also we have to check it our blog right now to do and to check it.
First of all, I want to check it out.
Which user user would be our request to do that?
That means which user is already logged in that our current users have used to display that current
user?
It will be as a request request, user request user means our current user and then sorry, current
user.
And then I want to do I want to add our block.
That is what exact we blog post this user put that comment to it will be as a blog and blog will be
as our blog.
Right.
That means that is a clear block.
So that block will be our block.
So no, I pass it perfect.
And after that I will want to save it.
So with the comment, with this comment, I want to save this data.
So right now I save it.
And after when I save it, after that, I want to pass it to one of the base.
So it should be written.
And with our EDP response to that effect and then the reverse.
Right.
With the reverse, I want to do and pass all this specific case.
I want to pass it to our that means so in this user will put any comments, then it should be directed
toward the same page.
That means that is our little space.
Right.
So if you go to details s that means if you go to our you in our app blog, if you go to that, you
are I have already created one of the paths as the details and after the details.
Also there have some of the slack.
Right.
And also name it with our blog details.
That means in our blog and then our blog details.
So now I want to be able to pass it on here.
So first of all, our app name app name will be as the app Underscore Block.
And then I want to do pass it in our blog title.
Space, I hope is very much clear to friend.
And after that they have also one of the.
Heidi, you can see they have also Didymus, I am here using the slack, right?
If you go to our detailed space and you can see the regular details and after the details that have
our slack.
So here, if you want to pass it, then you have to pass it with the key argument.
So fundamental.
I have already discussed of all the things we do.
So here, if you want to pass it, then you have to pass it to the key argument.
That means OK with the key argument, with the key argument we have to do, we have to pass it.
So now to do and pass our witchdoctor, I want to pass laws that are right so that you are telling me
that Aslak so here I pass it and also requested that we requested over here.
I also pass all requested parameters.
Aslak so so be our decision.
OK, so I just simply pass it on here I hope is very clear to friends.
So now here I have to do I have to pass our form.
That means that is actually our custom form and I just take the things with this variable as a common
form.
So now here we have to pass that form.
And I also hear about the visibility in our blog, details specific and the visibility.
You have to pass it in our dictionary.
Right.
So after that.
After that, I want to do to pass our key and then I want to pass it on this custom form.
Perfect.
So that we can actually use our this custom form in our blog Little Space.
So now we have to do we have to work in our blog details now.
Go to our blog details template.
That means that is our blog and there is a blog Titos template.
So I want to do and of visibility after this like and after this here, I want to do undertake another.
If I take another baby and I put on the roll, then it's a little bit better.
And I want to segment with the two column.
That means I take another Dave.
I make that as a call s.m Gaullism six by six.
So it'll be at the Coliseum six.
And I also want to undertake another one as I call six.
OK, so into the Coliseum 63 I want to do and the visible all the top comment.
So I take one of the five back and it'll be as a comment.
OK, so these are all the comments and then you know, our disposition.
That means, you know, another call, some six here round to do under the load of the form.
So if you want to do that foam, I think you already remember that this will be just like the same.
So you don't need this action.
Only we need that method and method will be as opposed.
So into the view here, I have already checked it.
That means our guest post.
And first of all, I take it as a post right now.
Everything is just like that.
Same before.
So now what do I want to actually displayed on here?
So this will be from here.
That is from our view.
I pass our custom form, take the things with this variable, and here I pass it in our dictionary area
with the contact form.
That means a comment from.
Right.
So now to simply use it.
So here it will be as our common form and into the common form area if you want to load our Quispe.
So here we have to do have to load that crispbread.
So bitter I take it, you know, create blog because I loaded that piece.
Now, first of all, I want to do and to load it.
Let me see the blog details here after that.
Bedstemor, lighten the load our this case before and now I want to do on to access it.
So I copy it.
And here into the common form, I want to display our case before and after that.
I have to do I have to load our Kiselev token.
Right.
So I make it as a C as AALDEF underscore tokin.
So, so we as I see a set of talking and after that I take one of the button, OK, I take one of the
button shall be as submitted.
And also here we don't need this name.
I want to load on the class and load all the classes will be as a burden with the primary and between
s.m ok.
Should be as a bit nessim and then it'll be the comment that will be the common button.
Perfect.
So now let's check this out.
Now if you click on this Savol and now if you first of all, check our server and here you can see still
getting some of the arrowroot, some getting some that in our that is our forms in the forms line one
is from Django Input Forms.
Here you can see there is a spelling mistake.
So that will be the forms, uh, that is in our forms.
You can then make it as a form.
This will be the forms for R.
S, right.
That will be the forms.
And also here you can say make the things correct on here, but I would put it in wrong.
That means they have some of the spelling mistake.
Let's check this out again.
Going to save all.
Yeah, you can see it's not perfect in the running.
Now let's check this out.
If you know, click on the refresh.
And now go here.
Yes, you can see it's not perfectly visible, our comment and here that is our bottom, maybe they
have some of the spelling mistakes in our class.
That is the beauty and beauty and primary you can see also there is a spelling bee and they are quite
right, primary and written as click as a Savol again, refresh it again.
You know, this is perfectly getting and better.
I want to put some of the bracket OK.
I put on the bracket and then that is our end blog.
No clue to save all.
And now refresh it again.
Yeah, you can see that in our blog and the result end of the day as a comment.
So friend, I hope is very much clear to you.
So that is our common form.
You can see I loaded our into the formula and your comment field.
That means if you go to our model into the model area I have already created on the field as a comment
and the model that will be type of the text will type.
So right now, consider the textual type.
Right.
So now I want to do right now I'm already logging with the test, so better I want to do to create another
account.
And with this another account, I want to put some of the comments on particular display.
OK, so then it's really better I click the log out, so.
Right.
No, I didn't create any one so better.
I want to create another sign up and I just name it as the audience.
OK, and I put the audience at Gmail dot com and put the password as you do me.
One, two, three, four, five.
And you do me one, two, three, four, five.
No I want to do and to create all the new account as the audience.
You can see I can't create a successful go to a locking here.
I name it as a guardian and or password.
You do me one, two, three, four, five.
Now because the login.
Yeah I can see right now I'm logging with Adient.
Right.
So this post is created by the test that also created by the test right now to do the ports on the comments
for particular this post, because I read more and here I want to put that comment that this is nice
because a comment.
Yeah, you can see they have no error.
That means our comment.
Instead, it affects us fully.
So if you want to check it like here, want to check it, go to our.
But I want to open another new tab, then everything will be more clear to you.
Click, enter.
And here our name will be as Amjed.
And then the password you give me one, two, three, four, five.
That will be our actually support user click as a locking.
And now if you go to our comment.
Yes, you can see it's not perfectly visible or common sense, this is a nice and here into the common
area is visible our name because of all.
If you go to our model, if you go to that model in the model area, you can see for the comment I have
already declared our is telling you the sale and then our common name.
Right.
In the return of the comment for the results, you can see it's not visible our discomfort.
That means we can successfully now insert that comment and also consistent showing us the area that
means which that actually put that comment is visible.
Right.
And and also is visible.
Which block that pins which block this user.
Put that comment, writes a friend here.
I have already declared that part in our model area.
So now I think it should be very much clear to you.
You can see I have created that relation with the blog.
So for the reasons is now getting that data, which blog and then the user also have created that relation
with the user that we see with our user class.
And then our comment right now consists now showing our then our comment, I hope friend is very much
clear to you.
So now I want to do and actually get this data so better.
I want to add another one.
That means here I have already answered one.
I take another one as a wow, it's great.
OK, I name it again, as always.
Great.
Click submit now go and go dot com.
And again, you can see there is another one as well.
It's great.
So now on to don't actually get our this comment data and I want to visible it in our particular disposition.
OK, so here I have already declared another call, SM six.
So now I want displayed in our this blog details into the blog details.
So that is our form and that is our another one as a call, as some write software that I want to do
visible it.
So here, first of all, I want to show our user name.
That means here I want to put on the Hatif and I want to display our user name.
So if in the display that user name, I think you already remember that part.
Well, how what exactly you have to do.
First of all, if you go to our form, that means, in our view, into the from the view I have already
passed, you can see I have already passed that block through with this block.
We get all that our object data and we pass it to our blog, Little Space.
So now with this block, I want to run all the follow loop.
OK, that means, you know, our block details here.
After that.
After that, I want to do undertake one of the for loop I take as a four and I just named I want the
visible to the name as a comment or whatever he wants.
If you want to make that things as a role, you can you name it as a role.
So even then what in then I pass our block every data with our D block.
Right.
So now I want to pass it with the block.
And also here we have to do we have to get all the top comment.
Right.
I want to display all that our common in particular, that area right now, they have the two comments.
So if there have multiple comment, I want to get all that comment from here so you can to get that
comment.
So if you go to our I have already created that relation into the model area.
I have already chelated created the relation with our block.
And I named that relation in the related name as a block comment.
So now with this block mean we can get our specific, this user all that comment.
Right.
So now for the reasons that I want to do and to actually use our D related name.
So I copied and now in our that is our block details.
So it will be with this block.
I get our specific, this user, all that comment, that means the block comment.
And I want to do and get all the points, I want to get all that comment right.
And from here we get a specific this user, all the data that means common data.
And I take that with our these comments and now with this comment, we can display everything with this
comment.
With this comment I want to do on the display our user name.
That means our user name will be visible and then also after that, better.
I want to first of all and it that means that and our FA and for and here I want to do on the visible
our with the comment, OK, with the comment I want to do on the visible.
Our filename, our filename will be I have already declared the phenotype.
I feel them is the comment.
Right.
So now I to do get our this comment.
So here I display our comment.
OK and better to and to put on a bracket.
So after that I put on the bracket and then I also want to display our display, the comment that you
can also displayed which I want to do, and put that comment that we thought I and also I want to do
better to first of all.
One of the H six, OK, here, I take out the eight, six and I and then I want to look at the visible
with this comment.
Look with this comment I want to do I want to visible our comments that that is all we should be visibly
or commended.
I hope is very much clear to you what exactly the things I did on here.
So now let's check this out.
If you click on this table and note, first of all, and check it.
Everything is running well now if you go and refresh it.
Yes, you can see it's not perfectly visible.
That name that we use are actually put that come in and that is our comment is visible.
And also it's visible that date.
Right.
So better on that one to make that as a bold, uh, here.
That actually are comments.
So I make is on the ball tag and the Baltic area and want to pass it.
I pass it on here because they're Savol and now we freshet.
Yeah, it's perfect.
So that is our area.
And actually putting that as a great is great.
And that is this is nice.
Right.
And also if you go to another one like the or another one click is a read more than I name it.
I know I'm already logged in with the Ardian so now I name it as a this is the best best blog site or
blog post.
OK, so I bought this table one of the comments like as a comment and I'll go here.
Yeah.
Can see it's not showing Azarian and this is the best blog post.
And then after that I have a friend who is very much like to you.
We successfully pulled that comment and also in our database and the database is also perfectly visible
that every name that is a common post.
Right.
I and we successfully complete that part.
So, you know, next video on to discuss about how can working with like or dislike of this post, that
means if you want to like this post, how can like it if you want to and like this post, how can I
like it.
OK, so I can do that work in our next video.
I will.
So that things with a live example.
So thanks for watching and I will see you in the next video.