Hello, friend, welcome back.
In a previous video, we successfully kept our all the View base, right?
And now I want to do I want to load our form.
So friend in our basic fundamental I have already discussed about that things with you.
How can load all that musician to be from on here and from here?
How can insert that data?
So previously we said that all that word before Django is a so right.
Then we will insert all the data from here and it will be inserted in our database into this position.
So first of all, I want to work for our organization.
So here I want to load all the other musician form data so we can to add that form data.
So right now we don't need this everything.
I just remove it.
OK, so that is a model into this model.
I have already defined that three of this field.
So no, I want to do I want to work for our form.
So that means here I want to load all that our musician form data.
If you want to work with this, then you have to do have to go to your first application.
And that is our forms.
Right.
So you can see previously I have already discussed about that things with you.
So here I have defined one of the class as a musician.
So right now that is our validators.
Right now we don't need this very data.
I just simply remove it here.
You have to do we have to define your Django input forms?
That means that one of the building form liberty, OK, that is are forms.
And also from our first application form, our first application, I import that models.
That means I import that models.
Right.
So now after that, there is our class in this class area I want to do to create one of the class as
a musician form.
And then I have already discussed about the things we do here.
I inherited it with our forms.
That is our Django Library, that is the forms.
And here I define another class as a model from class, OK?
And after that I define as a middle class into this middle class.
That means if you want to create one of the class inside another class, then you have to define that
with the middle class.
Right.
So this middle class, I have defined that model that into the models.
That means with these models I want to access our musician.
That means in our musician.
That is our class.
Right.
So I think you already know about it because we did the same thing.
So now we will do that again.
The model I define our model name as a musician and then into the field area.
I want to do want to take all the data.
That means, you know, models here.
They have the tree field.
I want to take all the data.
Right.
So for the reasons here, we don't need to create anything because everything I have already created.
So right now I want to use it.
So that is our fields, all the data.
So after that, what exactly we did, we have to actually load our form.
Right.
So if you want to load this form, we have to work in our views.
That means here and in particular that our function that is in particular dysfunctionally.
First of all, I want to load our all that field.
Right.
So that is all that field I want to load.
So if you want to load it in our dysfunction area after this, OK, after this here you have to work.
So I just simply defined as a form.
OK, so make sure you added input this form.
So here I have already added this.
So with this form I first of all create the object with this form object and I just named that form
object name here in our form area.
I defined that name as a musician form.
Right.
So that is lower class.
So now I just simply copied and now here I created one of the object for this one that is our musician
form object.
So here I just simply defining it.
And now we have to do we have to pass it right.
We have to pass it in our dictionary, into the dictionary.
We have to pass our title.
So after that, after that also I want to pass out another one, as I just name it as a musician.
That means our this one.
So here I pass it, our musician form and into the musician form.
I want to pass this object.
That means I take the things with this variable as a form.
So here we have to pass it.
So I just simply pass it with this from like a friend.
So now we have to do we have to work in our Fast Tap and our e-mail page as a musician.
Farmers Tamalpais right to now go to our template and the final step, and that is our musician form.
So here we have to do we have to load on the form.
Right.
So I just simply defined all the form and then into the form.
We don't need any class.
I just simply remove it.
And also here we don't need any action.
I only need that our method.
So here I just simply remove it.
So there is a pause to better I make the things that the capital post.
OK, and after that here I want to do want to load our musician.
So here I pass it, I pass it with this musician form so that the musician forms.
I just simply copied.
And now here I define as a musician from so into the musician form it should be loaded.
All the talk from and from here I.
Also want to do want to insert this data, right?
So if you want to insert that data, as I told you before, then you have to do we have to define your
percentages and here you have to define the CSF.
And so simply defining the CSF because we don't see a set of token, you cannot insert any doctor.
Right.
So to simplify the token, that means the accusative token.
And also after that, I want to define all of the input field and input.
Die by name to the submit, say just name it at the swap meet and also put that name will be at the
submit.
And here I define that value.
I define that value as add musician.
OK, just name me that the admission, this step up on the bottom, and also if you lowered your musician,
then automatically you should be in one line.
So if you want to make that paragraph, then as I told you before here, you have to define as a dot
as underscore B, right.
So it will be now loaded with paragraph wise, that is one by one.
So just simply load it perfect.
So now our form that is our musician form should be visible, like I just click as I save all.
And now I want to check it out, Sara.
Yeah, everything is OK now go here and go to the home, refresh this space, go to our acquisition.
Yeah.
You can see for that position, they have the tree field as a first name, last name and the instrument,
and that is actually our text.
So here I define some of the text.
So that is actually our text is not visible as a D1 and after this I load our form so you can see it's
a perfectly loaded.
So if we go to that model into the model that is actually the three field as a first name, last name
and the instrument.
And you can see that is the first name, last name of the instrument.
And also here, if you want to update your botanist instead, then you can also do it because of all
we are using the bootstrap.
So into the bootstrap, they have the lot of the court like here.
So here at the front of the class, at the front of the class as a VPN between primary
and primary and then Vitton.
That is s.m.
But I just simply because that is actually one of the bootstrap class I'm using on here because I save
all.
And now refresh it, yeah, you can see it's now become updated and also here you can see that is by
default actually getting that name.
So if you want to change it, I have already discussed about that things with you.
If you want to change it, if you want to make that things as your own name, that you can use it with
using that argument.
Right.
So right now, I think you already know about it.
So now I want to do I want to save this data.
That means here, if you put your first name, if you put your last name and the instrument name and
after that, if you click on the ad position, then it will be save all the data and then this data
will be saving our database area.
That means here.
Right.
So how can do that?
So if you want to do this work, I think you already know about it what exactly you have to do.
So that is our post.
Now we have to work, in our view, into The View and that is our method that is here.
That is our function as a musician from to the musician form.
First of all, here we have to define some of the conditions.
Right.
Should be just like that same what exactly we did before.
OK, like here I do that again.
Like here.
First of all, you have to define the if condition.
And if with this request, if this standard mattered right into the method, you will first of all you
should, which is better than not say to simply define as opposed or when it will be paused.
So after that, here we have to define our form.
So I just simply claim it as a form.
And then without these forms, so many forms, without this form, I have to define our musician form
before that was actually empty.
So now, first of all, I want to store all the data.
So here there is a musician form.
I just simply defining it and the request.
So I think you already know because we did this work before we the same things I am depending on here.
And after this I want to do want to define our if condition again, because here I have to do I have
to insert this data right.
I have to save it and I have to commit this data into this database.
So far, the need that if I define our form so into the form, first of all, I want to do it as it
is valid or not.
So I just simply defined as a valid if it is valid, then I want to do I want to I want to save this
data that was able to save all that or form data.
Right.
I want to save all that or form data Sadaat save and here I want to save with the comet.
So with this comet I want to do and to save it.
So if you want to save it then you have to define the comet as a true say, the sun as a true.
And when this data will be inserted between this data will be comet, when this data will be inserted
in our database.
And after that I want to do it will be redacted to our homepage.
Right.
So if you want to reject it to the homepage, then you have to do we have here you have to return it.
So here you have to return it in our index function.
Right.
I have already created one of the index function into the index function.
I will load that inside in that hour, which pays out in there are index data stable.
So here I want to do I want to define as a return and then our index function is to be done with this
request because they do this in this function.
That is a request.
I just simply find that request.
OK.
So that's all.
That's all you have to do.
So here I have defined that two condition.
I think you already know about it.
So from here I want to do anything at all that our form data that is the musician form data.
So now let's check this out.
I want to do and check it as I save all I have to save all.
First of all, I want to check it.
Yeah, everything is so perfect.
Now go here.
We fill this space and no one to do.
I want to insert some of the data in our database.
I have already been in search of the database, one from our admin, from this admin instead of the
ghazarian.
Right.
So now I want to do the find another one.
I just name it first name as a Michael Jackson.
I simply identified as a Michael.
Michael and the name I defended, the Jackson and then in a statement I define as a toddler, OK, toddler,
and now I want to do insert this position as an admonition.
Yes.
Now, see, friend, when this data is inserted, as I told you.
So here I have defined this condition.
So when this that will be successfully comit, then need to be tended to our index, that means here
it should be our index and here consistent showing our home page.
So now that means our data is successfully inserted.
That means if you go hear it again.
Yeah.
You can see there is another I decided as the two idee, the first name as a Michael and the last name
Jackson.
And I define the instrument as a tabla.
Perfect.
And also if you go to add me and here if you refresh it again now you see is also successfully inserted
on here.
So now I want to do and actually read this data.
That means from our database, I want to read this data and I want to visible lead in our home base.
That means here it will be visible.
So here, if you want to work with this, then you have to do we have to work in our index functions.
Right.
So now go to our index function.
That means into the index function area here.
I want to turn to, first of all, get all the data.
So I just take one of the variables.
I take one of the variables as a musician list.
OK, so I just name it as a musician.
Underscore least I take one of the variables and it is variable.
I define our musician.
That means our table name, our table name as a musician.
So I just simply define our musician name.
And from this table I want to look at all that, our objects.
Right.
So I just simply defined as objects, all the objects.
And also if you want to define the order by then, you can also define that order underscored by and
I want to water by with our filename.
If you want to autobody with the first name, you can define that first name, last name and the instrument.
So now I am to use that first name, so I just copy it.
And here I define our order by the first name and now we have to do we have to pass it.
So we have to pass it in our diction.
That means here because in our index page I have to visit both of the regions here.
Here I want to define our this variable so that the Army specialist and I just pass the things with
the name, with the musical list.
OK, so here I just simply defining it.
And now we have to do with this mediation list.
We can actually display our all the data in our index base and what our index estimate that means in
our template and result in the next.
So here I want to do want to change it.
So here I name it as a list list of musicians for musicians list I want to visible and here I want to
visible it.
So here if you want to visible.
First of all, I want to define that.
With that you will OK with this.
You will.
I want to display it.
And here, first of all, you have to define our condition.
That means our if condition.
So I just simply defined as a percent is the percentage.
And here I define our F condition and the condition.
I get all that name, I get all that name with the musician list.
So now I just simply copied and now here I define as a musician.
OK, so here I define different if condition.
That means if there have any musician list then it'll be display.
All that musician and Ilze Aless will be displayed on the one.
So, but I wanted one to finish it.
That means I want to finish out this if condition, so I have to finish it, say the assembly and if
OK, and here I want to use that our health condition so into the Ayles ls OK Aless will be displayed
so that another text is is still with displays on the another text with a Sytek here I define.
So we display that no musician in that list.
So this step up, one of the messages will be displayed.
Right.
And if we get any data that means if there have any that are there should be displayed.
So here, if you want to display this data you have displayed with using that for each.
Right.
So you have to display it with the for loop.
So here, if you display that for a loop, I think you already know about it with the FA.
And here I want to name it as a musician, OK, name it as a musician and in our list musicians list.
So now we want to display you all that from data that means to all that our database will fill that
out and you have to display it with this musician.
Right.
So now we have to do we have to also finish our D for each submitter I want to do and to finish it.
So I want to define it and for OK, I will just simply define our and for and that will be our Ilze.
Perfect.
And now here I want to do want to define our L I want to the L I want to display all the list here.
I want to display our first name, so with this musician, we have to display it.
So with this musician, I want to display our full name, full name.
So if you go to our database and into the database, you can see our name as a first name, last name
and the instrument.
So better go to a structure.
And that is our first name on the visible.
So here with this musician and display our first name, OK.
And also I want to do want to take another one.
I want to display our another name as a last name.
So here with this musician and display our last name.
So our last name will be as a last name.
So now let's check this out.
If you knock together, save all of us to follow the check it.
Everything is well.
Go to our base.
That is our home page.
Click the refresh.
Yes, you can see right now I have that data at the Kazarian and the Michael Jackson and the Michael
Jackson Starbucks, the three that is added, uh, like here you can see there's a tree that is added
as a one, two, three.
But it and remove it, remove it.
So now we have to do we have to go to our home base again.
Refresh it.
Yeah.
You can see now it's perfectly display our Cancerian and the regular Michael Jackson friend.
So now if you want to do if you want to add new one.
So now go to our mission.
And here if you want to add new one as a Taylor Swift, I just nimbly defended Taylor Taylor and the
Swift Taylor Swift, and I just name it as a lagging indicator.
I just named it as a guitar.
OK, sorry to hear.
So don't click on the admission.
Yeah, you can see that Kazarian that Michael Jackson and our Taylor Swift.
So every data is now actually comes from our database table.
So from here, every data is now coming.
OK, so I hope we can all understand about it.
And friend here, if you actually refresh this page automatically should be considered this because
of what you consider is clearly the same.
So you have to go to the home and from here you can see a perfectly visible.
So we successfully complete our acquisition.
So from here now you can actually add your nutrition.
And also you inserted data to the database area.
And also we need all the data and visible all the data in our home base.
So also we have to do the same things for our ADD album.
So here also we have to load our album form so we can do that work.
In our next video, I will show you that things with the living sample.
So thanks for watching.
I'll see you in the next video.