Hello, friend, welcome come back.
In a previous video, we have created one of the farm with using that storm attack, right.
So now in this video, I want to do want to discuss about the have also of the building farm in Django.
So how can you use this building farm and with this building farm, how much easily you can create this
type of farm in this video?
I will show you that things with the live example for doing this.
First of all, we have to do we have to create one of the farm file.
So in our application, that is our first application.
Right.
So this first application, I want to create one of the new file.
So I just got a new file and here I just name it as a farms.
OK, just name it as a farm dog fight.
So I have created on the file as a farm dog fight to enter.
So now you can see there is a flower farm start a fire fight.
So now here first of all, we have to do we have to import our Django building forms.
Right.
So here I have to do that work.
So I just simply defines the farm and the Django.
So just simply defined as the farm Django.
And I want to do an import and import one of the building on the function as the farm.
OK, so I just simply defined as a farmer in particular that position.
So as I told you, that is not the building of the farm.
So that is the building form into the Django.
For the reasons here I defined as a farm Django just import our D farm.
And after that, if you want to define some of the farm, you have to defining it with the specifics
of the class that we actually did for our model.
If you go to that model that I have created, two models are the musician and the album.
So here I define every field that means our every database stable as it with this class.
Right.
And after that we define some of the variable.
Cecil B..
Just like that.
Same here.
We have to do the same things for every farm.
You have to define one of the class.
So I just simply define the class, OK?
Just simply define the class and just name it as the user and the farm.
OK, I just simply defined a user form.
And here, first of all, we have to do we have to define with our D forms and here we have to define
our form plus.
So I just simply define our forms.
OK, so I simply define our form class in particular definition.
Perfect.
And after that, also here I have defined some of the field rights.
I have defined some of the field input field as a user name, and also I define the field as a user
email.
So for every field you have to define that things in particular that area with the variable.
So for the every field, you have to define it so better.
I want to take one of the variables.
I just take on the variable as it user and the name.
OK, I just name it as a user name.
And then with this form that with these forms I have defined one of the type I think you already know
about it.
So here I define the character field.
I just simply define the character field type.
And also I have to do I want to take another one for our user email so they step up on the farm I want
to use.
So I just for this or am I just name it as user underscore email.
OK, and then I just simply define with these forms that means with our form class and here I want to
do I want to define the type for the email.
I want to define as the type as email type.
So I just simply live in an email field reference.
I just simply define two of this on here.
So now if you want to compare it with our estimate code like you here, if you copy it, I just simply
copy it.
And now in particular that position, I was simply defining it, OK?
And I just put that things at the height.
I just put that in particular, that area.
Now here, first of all, that is our input type input type.
I have defined in our e-mail as a text and also into the forms.
That means that is actually I told you that is one of the Jianguo input, one of the building forms
in the form I define that character type.
That means that character type will be the text.
Right.
And also after that I define as a name.
So this name is actually means our D on here.
I define that things with one of the variables.
So that is a variable name as it user name.
OK, and so I just simply define two of these in particular that area and also by default it will be
as a required.
So they have also different type of attributes step by step.
I will also show you how I can add different type of attributes into this Django form soon Django form.
Everything is already built, so you have to just call it so.
Now we have to do we have to add our this form.
That means before I have added our D form in our view, right into the view, I have already created
one function that is our form function in particular that position we have to defining it.
So we have to defining it.
That is our form.
So we have to first of all, define that part.
So if you want to defining it, first of all, we have to load our postings.
First of all, we have to load our into the first step, into the final step.
I have defined this form.
Right.
So now, first of all, we.
To loaded second to load it after this.
OK, I doubt that these this are simply defines the farm sorry.
From our position, from our far steps, I just simply defined as a fast OK from our first step.
And after that first step, I want to import it.
So I want to import our form.
OK, and we want to put our doctors in step, I want to put out this form so that disclosure forms are
good and also we have to do we have to create the object.
So we have to create one of the objects here.
I defined that our class name as a user form.
So we have to create the object for our this class.
So in particular, that position that means in our dysfunction area.
OK, after this here I define one of the name.
I just click on the variable as a new underscore form and I want to create one of the objects so our
object.
So here I have to define our forms.
That means all these forms, OK, into the forms, into the forms area I have already created of the
class.
So here I have allocated all class name as the user from.
Right.
So I just simply copied.
And now here after this form I just simply define our this user from class.
So I simply define what this class name.
OK, and I hope is very much clear to you.
So now we have to do I have already get all the tower to fill data.
So that is OK to fill that.
I have defining it with this object and I just take the things with this variable so no one to do and
to pass.
It was because of all we have actually displayed in our displays.
Right.
We have to display in our form that is stable page.
That means that is our form, but it's Tamalpais.
So here, if you want to pass it, then here I want to do and define of the idea fast.
So I just named that idea the test.
OK, I just name it as a test form, so I just name it as a test form.
And here I want to learn to pass our all that, our variable.
That means here I have already defined all the things that with our form and I just take the things
with this variable and now I just simply posit in particular that area.
OK, so I just simply posit in our discussion and also I context it, I context it in our dictionary.
So here I get all the things in our dictionary that means in addition into the dictionary, have already
passed out this discussion with this context.
So that is our discussion.
So now we can actually use our D form in our D fast app and in our form, as Tamalpais Lightford I hope
is very much clear to you.
So here I just pass all the data in our farmers Tamalpais.
So now we have to work in our form is Tamalpais.
So now go to our first step into the fourth step that is our farmers CMO.
So that is our e-mail form.
So better able to do on to cause here.
I also want to display our Django form in particular the same pace, so I want to change that name.
So this is, this is created OK, created by e-mail Corb.
So just name it as a created best simple code.
And after this, after this year I take the H h attack.
So with this attack will be actually created some on the line.
OK, and after this here I want to do on the define and address this to tag I define under the street
tag sorry.
Defined that is three tag and here I have to do have to define that form.
So I just simply defined that form on here.
So that is the word class.
We don't need this class.
I just simply remove it and then also index XHTML.
So here I just make the things as a blank and methode will be as a post C in particular that area.
So here I want to do and to display our names.
So here I have already defined our form.
So to this form I have to take that things with this variable that means this idea as a text from I
just simply copied and now here I just simply pasted that mhere our form will be loaded.
That means our Django form will be loaded.
TriQuint I think it should be very much clear to you because here I already define our this form and
I take that things with this variable and into the decision here.
I define that idea into this idea.
I pass out this form that is a new form.
And also here, if you want to display our A3 like here, I also want to display on the I this I have
already discussed about that things with you.
If you want to pass on the text, how can do that work like here.
Simple things.
I take one the ideas a headline one are heading one.
I just came it as a heading this one and in particular that position.
I want to define some of the text as a this is OK, this is from using Django Library.
Django Library.
OK, I just name it as a general library.
So you take that our ID, so our ID is this one as a heading once I just simply copied and I go to our
estimate, one that we e-mail that farmers general in particular, that position here I want to display.
So the simply displayed OK, I hope is very much clear to you.
So now let's check this out.
If you now click as is Savol, first of all, I want to check it.
Yeah, everything is right now go our fan base, so that is where you are as a form, a refresh.
Yes.
Now, considering now, I hope it should be very muscular to you.
So that is our estimate.
Cold so that me with this estimate coat, I have created one of the foam and that is our Jianguo Lively
form, how much easier it is you can see without creating any field we actually define.
Our tour of this field will be as a user name and there will be as a user email so that our email field
that the user feels right and also here to define our text.
So now it should be very much clear to you what exactly the things I did on here in the form here I
defined to have this object on object name as a user name.
So by default, actually getting this name, that means by default, actually getting this name.
So here you can see that name is the user at the name and the user email.
So that is our variable, this variable, all the name.
So here you automatically get it.
And after that here, the front of the class as the user from class into the user, from class ab defined
to up the subject and into this view, into this value area, I simply define all the variable as a
new form.
And here I have created one of the objects.
Right.
So I have created all the object.
First of all, I load our form, piece that piece in the form page I imported and into this form with
this form, I want to access our D form piece into this form base.
I have created one of the class with our class name, so that is our user from class.
So I just simply refineries are from class.
Right.
And then into the dictionary.
I just simply pancit with this idea as a text from Idy and here I pass a new form that that means here
I just simply pass it.
So after that also take another ID as a headline one and this headline one here I define some of the
same data and here I take that things with distinction.
So we have to pass it in our farmers.
General, for the reasons with this context, I pass our restriction.
So now we can actually access out these attacks from Idy and headed in our form e-mail.
So into this form is simple.
I just simply display 8H three tag as a headline one and our action form area.
I just simply defined as a text from.
Right.
So now you can see it's not perfectly getting our D form in our form base.
So, you know, next video will do more things into this form area.
How can do that work.
I will show you that things with the live example.
So thanks for watching.
I will see you in the next video.