Hello, friend.
Welcome back.
In a previous video, we successfully complete our my blog piece.
So now in this video and we discuss about if you want to edit this blog, how can edit it?
So for doing this, we have to do we have to create one of the function right now.
Go to our view right now.
We don't need these.
So we move everything.
OK, remove everything from here.
Now, that is our view.
That is in our blog and that is our view.
So do the above video.
I want to create another function that is better than to create another class with view.
Then it should be better by the name of the class.
I name it as a class and now I name it as an update blog.
OK, maybe does the update block since the update block area.
If you use that class view I have already loaded up, that is our deluxe.
You can see I have already loaded that that view class.
So now with this update we class, we can do that work very easily.
So I want to learn to pass out this class.
And also, if you want to updated, this user must have to be logging.
So that means here I want to learn to use it without this class as a logging to get maximum.
So I also don't want to pass it on here.
That means right now, if you want to access this method, this method, then you have to master logging.
Right?
So now I update it and now I want to do want to pass out which things.
I want to update our specific block.
Right.
So here we have to do we have to add that model.
Our model will be our which one?
I think you should know it right now.
That will be our block.
Right.
So that is the block.
I have already put it our block class.
So we do the block.
Plus, if you go to our model, that is our model.
There is a block.
So here on the top, leaders of the field as a block type block contain block images.
So I would want to update it.
So here I name it our block model and also we have to do we have to set our fields.
So I named our fields.
Our fields will be like here.
If you go to write comment, log in the right block.
There is a lot of this feel right.
So I want to update out of this field data.
So that is our block title, our description and then our image.
So here I want to go on to declare all the turf field.
So to declare our field, our field will be as if you go to our model.
Our field will be as a block title.
I name it as a block title.
And then there is another one or another one will be as a block contain that will block content that
I want to update and also I want to do and update our emails.
So that will be our block image.
I felt I added to all of this and after that I want to do I want to pass it on to the template base.
That means the template name and the template name here I want to do and to load one of the templates.
So I have to do.
I have to maybe I already created it.
You can see I have already created or edit blocks and I want to do and actually load out this block.
So that is in our, our block and from the app block.
That is the edit.
It is not edit block.
Right.
It it underscore blog not as html.
So now I load it and also after that we have to do we have to declare our success.
You are all that means here.
One thing you have to understand, as I told you for every blog post, they have a specific one.
The idea that if you go to our database, it is a database here.
You can see there is a specific some the idea.
Right.
So here I want to do in our edit option will be updated.
So in our view, details I want to create on the edit button.
So it shall be updated.
There should be redacted to our particular step up on the wall.
That means it should be rejected or detailed space into the little space.
There have also one of the you all that means on the slide.
Right.
So also here we have to do we have to pass it so better.
They have also the function in Django that is our dev and they have done the function as a get undressed
for success.
OK, forget America's success.
You are l that means where exactly to be directed.
So here I have created one of the function in the class idea.
So if you want to use any create any function, then you have to access it with the self.
Right.
So I have already discussed about the things we do and also here we have to do we have to pass on another
parameter as a key argument.
So here I don't want to pass that key argument with all and then our key argument, OK, that is our
key argument.
Pass it.
So here I want to do not retaliate right now as a return and before into of before.
In our functional view, that is our functionality.
We pass it.
With our return, with our SCDP, this monster that right, but in claspers view, they have another
one as a reverse lazies.
So here we have to do we have to pass it.
Um, you can see I have already loaded I have already loaded up the reverse and the reverse.
Lizhi So with this reverse Lizzi, you can actually pass that our left specific this user data, that
means one is to be successful.
That is, we can do that.
So right now and to do with this reverse lazy, with this reverse lazy and pass what exactly should
be redacted, be subjected to Autoblog.
And then I want to do and pass it to our if you go to our view that our blog, if we go to that you
are still here, I want you to pass it with our digital space for the little space that will be as a
block details.
So no underdo and pass it on here, OK.
And also after that, we have to do have to pass our this slag that this like we have to pass.
Right.
So if you want to pass that, like we have already declared that parameter with the key argument.
So with this key argument we can pass it.
So should be just like same before I pass it.
Our key argument and the key argument dictionary area I want to do want to pass and to pass our slack.
That will be our filename Aslak and then I want to do pass it.
Our dislike of the data is equal to access in as the anything that we see from Texas, any object into
the function area in our class, then you have to use it with the self, so with the self and the access
that object.
OK, objects like data soulsby.
I just like data.
Right.
So here, make that here.
You posit that these are details as I told you friend.
I think it should be clear, it should be the details and after the details space that have some slack.
So now you say pass it out.
Details that is a block details.
And in our example, that is our blog details.
And I have some of the slack.
Also, we have to parse it for the resource in our key argument area.
I pasar like, OK, like object all the data, I pass it perfect.
So that's all you have to do.
So that is our update blog and know what to do and to create one of the buttons so you can create that
button in detail space.
And then I want to do and make that in our blog.
That is my blog page because of all this user actually Cannex says that on post and in the post area
want to visible it.
So that is in all my blog into the my block area here.
I want to do all that on the edit button.
So now go to our that is our my blog.
Now open it into the my block area.
That is our details and that is our home and that is our read more.
Right.
And then that is our Read More.
And then our show is visible.
And after that, after this.
I want to do after this, Dave, the return of the Dave.
So better after both of this.
After both of these I take on the H.
R and then I take on the active and it shall be as edit
will be as eddied.
And here I want to do and to create on the wall.
That means here I have to create the you are all for this one for Exocet as you are.
L will be in our block sorry.
Into the app under the block area.
I want to create what you are as a edit, OK.
And this could block this table that you are allowed to create.
And also here we have to do we have to pass our idea because of all.
If you go to our blog, as I told you, every blog post that have some ideas, if you want to edit it,
you have to edit it with a specific one of the idea.
Right.
Also here, you have to do have to pass on the idea to get as a picture Primerica.
And here we have to do right now.
I'm already into the for loop.
I take that in every post related all data with this block.
So now with this block, I want to do in Texas our block table, our primary key.
That means our primary key is a primary key as a speaker right now.
And to do index Texas this idea perfect.
So now we have to do we have to create it.
That means we have to create our this wall.
That means that is in our our blog.
And the result is what else?
Better I copy it and I passed it.
So I name it as a edit block.
OK, name it as it edit blog.
And in the view of the Vaidya, I have created our name, our last name as the update blog.
So now I want to do add it.
It should be the update blog as view and I name it.
I have already declared it in our my blog.
That will.
As they eat it right there, it is blocked, so now I name it as a block and also the other area I have
to do have to pass our I.D. That means our picture.
So I simply pass it because of all here.
You can see I have already used it.
That means here I have to use that RPK as it will be our ID.
Right.
So now under the updated it, that means our elite block and then our this block I used to be visible
and then in our views our updated block.
Perfect I hope is very much creative.
And now we have to do we have to update our edit page.
That means in our view in our update blog, I have loaded our template as a edit block template.
So now go to our blog.
That means here in our template and the result is block.
So here I have already extended our business to email.
It will be the edit blog.
And here I want to do want to load on the form and into the format.
I also want to do want to use the word form so that I want to load that our kids form fast.
So if you want to load it right now, I think it's very much clear to you that the Lord and Lord, our
Quispe
Quispe underscore forms underscore cortex.
Right.
So that will be our Quispe form text.
Make sure you load it.
And then here you here.
I want to create one of the condition because of all here we have to do we have to take it.
Our user is perfectly our same user.
It's not like here if you click as if you want to update this.
Also, shall we check as this post is created by this user is are not for the reasons here, want to
do and put on the condition for the edit.
That means here to put on the condition of the eve and then with our uh, if we go to the model that
we see in our blog into the app log, if you go to that our Adblock model, see the model area.
So that is our alter.
Right.
That means I don't want to access our this alter.
So here I want to do want to put this condition, that is if our block with this blog and with this
blog or alter.
So first of all, we check at this auto is appropriate, our current user or not.
OK.
So shall we check it?
And also here we have to do we have to finish our F condition as the and if so, now in particular that
area I want to load on the form and I take only one the our method.
We don't need that action.
And even with.
So you do the formula media here, I would want to load on the form so I load all the form and also
I want to load our Crispi.
That means our case we form will be loaded.
So that will be as a crispy form.
And then also here we have to do we have to add our Kiselev token.
That means it should be as a C as underscore again, but that will be as you see yourself together.
And then also we need all the bottom.
I take on the button and button that will we have to submit.
It will be the subnet type here.
We don't need this name.
I don't want to put on the class.
OK, class as a bit in between Infl and then between s.m.
So this step one of the button I want to take, I'm here, I name it as an update.
OK, I name it as an object.
So this step up one of the name I want to put.
So if this user that means that if these are blog authorities our current user wants it be matched then
shall be displayed for this form or I would want to put them on the condition else.
OK, else it shall be displayed on the battlegroup.
I mean the paragraph that you OK, you are not allowed allowed to view the space.
So they step up onto the masses, it shall be displaced.
Now let's check this out.
Trend line click as I save all.
And here first of all and check it.
Everything is running well.
So you know my blog idea.
I have created one of the button on the edit.
Right.
It is better want to put on the class.
I put the classes a bit in between info and then return as simple as some of the class.
OK, for this button now because I save all, I can save all and now go to our site.
So go to our home page is perfect.
Go to our test on my blog.
Yes.
Hurricane season are showing our edit button and the edit here.
You can see if it's not showing our edit block and then the number of the idea.
So for the reasons here I put that link.
You can see there is a clear primary key that means our blog and that is our primary.
That is our database table.
The block table primary kidi OK.
It's not showing our appropriate idea, the nine that is actually showing us is six, and that is showing
as it is to right now, if you click on the edit, yes, you can see it's not perfectly directed to
our edit block and nine and also successfully loaded our form.
So here we don't need to do anything because of all the field area.
I have already cleared the three of this field.
One is for our title and they're contained and the images.
Right.
So that is our current image is visible.
If you want to change it, you can change it.
Like I don't want to update like here I make as a one one and one one.
I hate it because of that.
Yes.
You can see not perfectly updated and updated what exactly is detected is detected to our blog details
and then directly the the for the reasons here, I have declared that part in our view, I pass it,
we return and then reverse lazy and the reverse lazy.
Here you can see with this reverse lazy pass in our Adblock blog details and the blog details.
After that, they have some of the slack.
So now you can see snow perfectly redacted or details.
And with this lack like friend, I hope is very much easier to use right now from here.
If you want to update any post, you can update your post from this position.
OK, so there's another one.
There is another one if you want to.
I also want to change that image.
Just click on the edit like here and the change that there is currently made.
So now they're done to change it and to add new one and I just choose this one.
Click is open because the update.
So now here you can see friend is not updated.
It's because of all.
If you go to our form, as I told you before, and if you go to our edit, that is already a blog.
And we the edit block here, that is chloroform into the form area here.
As I told you when you were working with the images here in the images area, you have to we have to
apply as the NC typewrite.
So here you can say is that NC dependency will be as a multiplatform data.
So make sure you added click as a save all now and to check it again, please refresh and now would
go back rather than better go to home.
My blog and I wanted to do other change that emails that we read more and now go to our edit and I wanted
to update our DC emails because of Penn and I choose.
Or this one.
I chose this one.
Click as update.
Yes, you can see now it's perfectly updated.
And if you go to our home.
Yeah, you can see some perfectly updated.
I hope people will understand about it.
Friends right now, if you want to write any blog, you can write it.
If you want to update this blog, you can update it.
And everything is now perfectly working.
I hope you enjoyed very much.
In our next video, we'll start a new session.
It's about I will create another project as a social media project with using that chango, so I will
see you into the next session.