Hello, friend will come back in a previous video I have already discussed about that form validation,
right.
So in this video, I want to discuss about how you can add your all that model data into the form.
Seeing Django, they have some of the building functionality.
So with this functionality, you can actually create some of the form without getting an e-mail from,
OK, how much easily you can create this?
I will show you.
So right now that is our application into the application and that is our farms.
Right.
So before I have already discussed about that validations right now, we don't need this.
I just simply remove everything from here.
So I have already created some of the model class.
So if you go to that our first application into the model and into the model here, you can see I define
some of the class as a musician.
So into this musician, I have defined some of the field as a fast name, the last name and the instrument.
Right.
So here right now, I want to do I want to create some of the form with this all that field.
So here are the three fields.
So automatically is will be created in the form with this all that field.
So how can do that work in this video.
I want to show you that things with the live example for doing this.
First of all, we have to do we have to add our this model.
OK, that means here we have to add these models.
So we have to add it in our form area.
That means in our form here, first of all, first of all, here we have to add it.
I just simply defined so you can actually add this with two different way.
First of all, you can add it as a form and then your faster.
That means our first application name right into the first application, into the first application.
They have also one of the models.
So just simply define our these models and then you can actually import then you can import your album,
our models, all the names.
So here I have defined two of this, one of the album.
Another is a musician.
Right.
So there are two class.
So you have to define two of the songs here as the album.
OK, album.
And also if you want to add another one as a musician.
So just simply defined two of this.
So that is actually one of the process rather than if you want to directly get all that model, then
you can also define that another way you can do that things with the form and is the form.
That is our first step for step application and this application you can import directly.
So just simply directly import our models.
So here I directly added our building Django function as a models so you can add a both of this right
now.
I actually want to use this one.
OK, so right now I just simply remove it from here.
Perfect.
And now we have to do we have to create one of the class.
Right.
So right now we don't need this.
I just simply need be know what to do and to create one of the class as a musician musician form.
OK, just name it as a musician form and in particular that position we have to integrate with our forms.
Right.
So that forms and into this form I want to do on Dex's another one of the class as a model for class
like this, a be defined as a model model and then form on the class.
OK, so this class will be inherited without this form.
So that means here with these forms, I want to access another model as that is our model forms.
So into this class I want to do I want to create another class.
So for the regions here, if you want to create another class inside, I want one class, then you have
to define that as a class matter.
So I just simply defined the class and the matter.
OK, so if you want to define some of the class inside the class, then you have to defining it as a
class matter.
So here I just simply defined that class matter and in particular that position.
We have to define our all the models right now.
I want to working with our this model, all that feel right.
So this field I want to define as the one of the form.
So for the results here, I want to do I want to define one of the model.
I did one of the variable as a model.
And then without these models, that means here I have already improved our models.
So with these models.
So with this model, I want to do in Texas our class name, our class name as a musician.
Right.
That means the mediation table.
So here I just simply define our musician table and into the mediation table.
Who is that how you want to take into the musicians table?
I want to take actually all that field data.
Right.
There is a first name, last name and the instrument.
So here I want to take all the field data.
So if you want to get all that field, then here you have to do it.
Here you have to define as a field, OK?
You have to define the fields and the fields.
I wanted to define all so here along the line and then all and then double on the line.
OK, so with this you can actually get all that uniform data from your musician table that.
From our musician class, OK, to this musician class, I have defined the field so automatically it
will be get all the field and I just take the things with this model perfect.
So here I take all the tower field and a flower class as our musician class.
Right.
So now I want to do I want to actually view it.
So if you want to view it, we have to do we have to work in our view that our application and there
is our view.
So previously I have working in particular that positions.
Right now we don't need this.
I just simply remove everything from here.
I want to study it again.
Like, first of all, that is our new form.
So here I want to do want to create one of the object.
I want to create the object with this form, and that is our class.
So here at the front of the class name as a musician form.
So I just simply defined that our object.
OK, so with this form, first of all, I just simplified of the object and after that I want to do
I want to define all of the conditions I defined as the if condition, if our request.
First of all, I want to check it.
It should be the post method or not because of all I want to actually save all the data.
Like if you go to our site, I have already created one of the forms and lauded in our home.
And here you can see I have already defining it.
Right.
So this form actually comes from our database area.
So if you go to our back, end into this bakin.
So that is our here I display our musician.
So now if you go to that musician into the musician, right now they have the two data.
If you want to add new musician like here, I just take me to the test and last name as a last test
and then instrument.
I just simply defined the Ironist test just for education purpose.
I want to insert some of the data because it's safe.
Now you can see our data is added successfully.
So now there is another one.
And also if you now refresh it now with this now perfectly added on here.
So I have already defined this part, right.
So here I have already defined this part.
And also I displayed in particular that area with our view.
So here you can see I have already discussed about that things with you.
Right.
So now I want to do I want to insert this same data.
I want to insert the same data.
First of all, here, I want to do find another form for this one.
So from to this farm area, I want to start our first name.
That means the musician, first name, last name and the instrument.
So for the reasons here I want to do, I define all that are formed.
Also here you this model, there are three that are that the musician class to have the three data so
that in the three field data, also the three feel that I have defined that things are familiar with
the field.
All right.
So now we have to define what this form for the reasons here, I want to define that F condition.
And if I first of all, I want to check it.
This is actually the post method or not.
So for the results, what exactly we did, I have already discussed about the things we do.
We have to define that things with our method as opposed post not right.
So I just simply defined the request request and then I thought, OK, request method, I'll post.
So to simply defined as a post or not.
And then I want to do I want to define our new form.
That means in particular that position before I have already done it.
So now we have to take our all the data.
So here are all the data.
I have to load it.
So for the reasons in our with this new form area, I want to load it.
So therefore I'm OK with this forms.
I want to do.
I want to define our this musician from data.
That means here I have already created the object and in particular that area.
I want to define our request.
That means our distinguished it all that force method, that is the data so just simply defined as a
post Gutfreund.
So I hope you can well understand about it.
And after that I want to do I want to also define like first of all, I want to load all that.
Our feed will be loaded and then it'll be insert this data, OK, this will be insert this data aspecific
our this model area that means in our musician model.
So for doing this, I want to do I want to define another condition.
So here also that you you added the column.
OK, so there is actually a column that the request perfect.
And after that I want to actually check it for checking this.
You have to define as the if condition.
I want to define another live condition and then without this new form into this new form, I define
as is valid.
It underscore valid.
Say I want to check it is valid or not.
So if it is valid, then I want to commit this data.
So I just simply define in our new form area I want to do to save it.
I want to save this data.
So I just simply defined the comet, OK, with this comet it actually save your all the data.
So I just simply find out the truth.
And also when I want this form, that means here whenever this form.
We commit and commit with our all the data.
Then what exactly should be redacted?
Also, you can define that things on here.
I want to do two redacted in our index methode.
OK, that Misener index function.
So into the index function.
I have already loaded our displays.
That means I want to do I want to load off all the pages in our formula.
That means here I want to load it all that our model data and then when it shall be submitted then it
have to either submitted.
I want to do I want to read it to our this index base.
So for the index I have already created not the function as index function.
Right.
So now I have to pass it on here.
So after that I just simply defined the return and return our index it be past our index function area.
So into this index function tab also on the request.
So I just simply defined this request, OK.
I hope, you know, it should be very much clear to you what exactly the things I did on particular
that area and also for access our form that meets our formula.
So they had our formula for success, this formula.
I want to do in our index here.
I want to add another bottom.
So if you want to add this button that is in our index base, that means in our template into the template,
our first application index into the index here, you can see that it is lower tax.
So that is actually the text.
So after this text and that is after this text, I want to go on to add on the bottom.
So right now I want to do the final link.
I just simply defined the Healthlink.
OK, so the simply defined Haviv and the if I want to define the link will be as a platform.
OK.
And a simply defined as add form.
And here we have to define our equal.
So I have already created this quarter.
So if you go to our first application that you order and here you can see I have already created this
form.
Right.
So now I just simply copy it.
So in our index here, I just simply pasted that is our form into this form area.
Also, if you submitted it, you have to reject it to another piece of other reasons.
Here we have to define as a semicolon Fast's.
I have already discussed about the things we do and also I checked it because without this issue will
be added another slash form after this form.
Right.
So that is the thing.
Now I am actually using so previously I have already discussed about that things with you.
Why you should use that semicolon before that form.
OK, so I just simply added on, added the form.
So now if you click the save all.
And now if you refresh it.
Now, I can see now it's added another link at the ad from OK, so after this I want to do under the
front of the bracket.
I just went to the front of the bracket and they had to add new, add new a bit better.
So I just simply defending it.
And now we have to do we have to load our form.
So here I have to find out you are a little deformed.
That means, you know, are faster.
And that is our form, the competition position here.
I define all of the feel right.
So here I define a field as a field and also the word token.
So in particular, this area, I want to work so that, no, we don't need this, OK?
We don't need this.
I just simply now remove it from here because in particular, that area I have defined that as a test
form as our paragraph's.
I have already discussed about that things with you.
And then also they have solved the headline one.
So now we have to do we have to take all that our headline one data and the text form data from our
model.
And we have the visible lead in our view.
So now go to our view in particular, that area we have to work.
So here we have to defining it.
So here we have to define as a we have to pass all that our data to the dictionary.
So far the regions here are the discussion into the discussion.
I just simply define our two things here.
I want to define all the things with our text form.
Right.
So with this text file to define that and also the idea as a heading ID say, to simply define the text
form.
So already here we have to define the single code, seem to the single code, we have to define our
text form.
And then I want to do and define our all the data that is in our new form that I want to load it.
So here I just simply define our Bolstad data.
And also after that I want to do under define some of the idea that means here I want to displace all
the data.
So in particular that position and that is our heading ID that I named as a heading one.
So I just simply copied it.
And now here it is simply defining it.
So for the heading idea I want to do I want to define some of the text.
What are the the text you want to write down to define as add new musician.
OK, so this step of one of the text is will be display perfect.
So that is addiction.
So there is addiction and there is all written.
So here I load our text form, our new form, Ducktown, that post and then heading.
I have passed and I take that things with distinction and in order that means a reader requesting our
faster form e-mail.
I have passed that things with this context.
That means that a declaration perfect.
So that's all you have to do.
Now let's check this out is to working on not I just have to save all.
I just care to save all now OpenNet.
Yeah.
Everything is perfectly working to have luchador now I just refresh it ok.
I just refresh it as they add new E.S..
Now considering now I think it should be very much clear to you.
So I explain it how that actually work.
So right now here I define our tax form into this tax form.
I define that on here.
Right.
I just simply defined as the tax form will be as battlegroup for the reasons here you can see snowshoeing
as a civil body and here they have the three forms.
So this three form that actually comes from our state bill is comes from our forms, our musician right
into the musician form.
So into the musician form.
If you go are from Syria into this from Syria, I define our musician form, our model in our trade
with our forms, that is, are the class of the model class.
And with this model class, I define our models, our musician models.
So if you go to our model Syria into this model here, you can see they have the musician class and
in here there is a false name, the last name and the instrument and also defined here, defined as
a model, one of the type.
So with this model, I define the type will be as a characterful type character filled and the characterful
type.
Right.
So now you can see the actually three field automatically.
Now it's visible on here.
So for this form, I didn't write any code right so perfectly now concedes no perfectly display our
T of this model field.
So that is our area of this model field is not visible.
Right.
And also in our view into the view, I have the front of the headline one and here I define as the add
new musician.
So in our performance jemal, I have defined that as a head any one.
So that is included.
So with this idea I actually visible some of the text.
So now let's check this out here.
I also defined on the condition like here and first of all, it should be checked as a post method or
not.
So after the initial bettag then I define as a validation here is value to the point which will be valid,
then it should be saved.
This data is still becoming this data are the true.
That means you should be save all the.
Inappropriate in our model area.
OK, and in this model, I have already lowered our pace.
So after that issue will dictate to our written index function that is in our index function pace,
it should be redacted.
Right now, let's check this out.
I want to be able to define as a a a last name I defined as A, B, B, and then C, C, OK, just simply
defined as the first name, last name and the installment of the submit.
Yes.
Now is your friend.
After successfully added that form is now redacted to which page is redacted to our index page and into
this index based consistent showing as the first name, the last name and the instrument.
So here I have defining it so that the written index, our, these secrets that we see in our index,
that is our index functions into the index function is to be elected.
So now you can see it's not successfully selected on here.
Right.
I hope you can well understand about it.
So if you want to add any one as a first name, I defended that.
You do me, you do me one and then you do me for the same purpose.
I'm using it, OK?
You do me to look at the submit.
Yeah.
Now, because it's not perfectly showing as you do me, you do me one and you do too.
And here actually friendly showing actually getting all the things ordered by our first name.
So that is the things I have already defining it on here in our index request that we no index function
here.
I have defined that part like you can see it from the musician that is out of the X of this will be
as in order by with our first name so far, the results actually start showing all the data with our
first name.
So now it's perfectly visible.
So how much easily you can add create some of the form with your model form I think is very much clear
to you.
So that is actually the main procedure you have to flow.
I think you understand it very clearly in your next video on the street.
Musician is about that template filters and inheritance.
Sulkin working with the filters.
How can working with the inheritance in the next video, I will show that things with a living sample.
So thanks for watching and I'll see you in the next video.