Hello, friend, welcome back.
In a previous video, we successfully complete our increase option, that means a product increase option
and the decrease option and also is successfully complete our remove option, that is our total price
is now visible to knowing what to do if you go to our checkout page.
That means they have I already found the button as a process to payment.
So here, if you click on particular that button, then it will be addicted to another page at the checkout
base.
So who can create this checkout based in this video?
I will tell you that things with a live example.
So for doing this, first of all, I want to do I want to create another application.
Business will be better.
So I have already created all the application as the app logging, the app order and the app shop.
So now I do want to create another new application and I go to our terminal and here I just finished
a pie and then managed to pay and then.
You stepped up and now I don't want to do on to defend our application name will be as the app underscore
payment.
So just name it as an app, underscore payment.
OK, so now if you enter.
Nokia CEO created our application.
That is our apartment and also, you know, temporarily, I want to do want to create another folder
with the same name.
So here I define that name is Silvy as the app underscore payment.
So I just name it as payment a friend.
And also after that, we have to do we have to add this hour this application in our main setting go
to the setting.
And here I know I want to run to run our server as a pie, sorry, here I just simply defined as a pie
and then managed to by and then run server the run server.
Yeah, or somebody is now running and now I want to add our application, so our application I have
created after this, after this I define as the app underscore payment so that our app payment rights,
I have created our application name and also into the application area.
We have to create that.
You are so better able to create new file and I just name it as you are else, not pie.
Right.
And also we have to do we have to add this pie in our menu, whatever that means.
That is our menu model.
So after this, after this, I just take another one.
So here I just simply find another one and still be as a parent should be as a parent and include our
app payment.
So just name it as app payment and then include our app payments.
You are perfect.
And now go to our Eurostep means here.
That is our apartment and that is our payment equal.
And this will be just like better.
I copy something from here.
OK, just simply copied a note in particular, that position that was in our apartment area that you
are still here.
I just simply passed it to still be from our Django views in Poupart and then that will be our views.
So that will be our app.
Underscore payment.
So payment and input that views.
And I just named one of the app name and I just name it as the app name.
So right now I didn't create anyone.
So I know I just make the things as a blank.
OK, now I just forgot to save all the for the payment that means for the app payment.
I want to do want to create one of the model.
So if you go to our model, so right now they're just setting, we don't need this model, we don't
need these that would allow also don't need this.
So now in our payment area, that is our model here.
I want to do want to create the model for our this checkout based.
OK, so now after that, that is actually right by default building as a models and also after that
I need our settings.
So I just simply defended the farm and the Django.
So from Django the comps stop to the config here.
I don't want to put our setting OK, I just import our settings right.
And then I want to do to create another class.
And I just named that class as a class and I just name it as a billing address.
I just name it as a billing address.
And here it shall be inherited all models and also the model.
Right.
So also that is all we inherit our models and the model.
And after that we have to do we have to define the words on the field.
So first of all, we need that user and user will be with our models.
And also here I have to define that our foreign key to our setting.
Right.
So I just simply defined as a foreign key,
so foreign key and then our settings so into the settings area that will be our auth user model.
So odd underscore user model.
So here you have to defining it.
And also I define all on the left.
That means that on the left and on the left will be as the same as a model in the cascade.
So models and that cascade.
Right.
So I just simply defending the user.
And also I want to go on to define some of the billing address details field.
Like I said, we need that address.
We need that zip code CD country.
Right.
So I just simply defined the address.
So address and this address will be as with these models and the type will get the character filtered.
So that will be as a character type and also here and want to defend the maximum length that Max and
the land max land here.
I define that as a 264, OK.
And also I make as a blank blank will be as a true so just simply defined as the two.
And also I want to take another one.
I want to take another as a G Corp.
So cold.
And this will be with these models and then character field.
So that will be also a character, character field and then our maximum length here.
I also want to define that maximum length and for this I will be as a ten, OK, and also blank.
So blank will be as a true.
So just name it as a true and then we will lead our city and the country.
So just simply defined as city, it will be as a models and then character field and then here for the
city a defense of the maximal land and maximum land I for the city I of the three party.
OK, and then blank.
Blank will be the true status symbol, defining it in the country, so the country will be the same
as the models and then character field and then maximum plant and then maximum land for the country
at the front of the twenty and then blank it will be as a true.
So I just simply defended the true perfect.
And after that I wanted to display some of them our return value with our name.
OK, so here we have to create of the function that is our function is to function will be as a SDR.
Right.
So its function here, I have to define that self.
So with this self here, we have to define the returns.
I just want to return the of the user name is then actually better actually.
So I just said, well if I would the if and here I want to do on the display our with this self self
and then our user.
That means with this user I want to do on Texas our model here.
I have already defined that our foreign setting.
If you go to our app, logging into the app logging, if you go to that model and actually visible that
our profile user name.
So that is, you know, our profile, you can see that our profile.
And here with this profile, I want to access our this username.
Right.
So here we have to defining it.
So I just simply define that with this user and then I want to define that profile.
So I just put that relation name.
That means a related name as a profile.
And with this profile, I want to use that our user name.
So I just simply define that user name.
And after that is a name which will be showing some on the message as a billing billing address.
So this type of what the message is that we display.
So here I just simply returned it.
And after that, I also want to do I want to check all that or feel that this field is empty or not.
OK, so here I have to also, first of all, check it.
So we did this type of work before, so no one to do until we find another function as a dev and I just
name it as easily, OK, is fulfilled.
So this step up, the name I have defined and it will be the self, right.
Because of all here, I have created one of the function into the class area.
And after that here I want to do a defined on the variable name as a field name.
So I just simply define the field under its own name.
OK, I just name it as a field name.
And here I want to do want to take our all that our functional name.
So here at the front of F name and then for F in self.
So that is will be the same concept that we did.
So it will be as a matter and with this matter we have to do have to get this field so simply defined
as a function as get fields and get fields.
That means with this here I want to do I want to get all that or feel like they have the same on the
field as the address field, the deep, cold, concrete and the country.
So still we get all the tower field, OK, so we get all the Darfield and take that field with this
variable.
That means our D field and variable.
So no one to do to add one of the four loops.
So here into the followup area for us to follow through, which is that this is empty or not, then
it should be add another loop for the cheap code is empty or not in the city and same as the country
equivalent.
So now for doing this, I want to create one of the for loop.
So here I define the four.
I'm here, I name it as a field name.
So I just send me to the field under its name, like a field name in here.
I take all the tower field data and take the things with this variable.
So now here it is simply defining it so better.
I want to do and make the things as a field so that in the field name and the names and then I define
as a field name in field names.
So that is plural.
And now with this we can actually defining all that our field.
Right.
So now here I just simply defining it.
That means our for loop and then I want to do and define that all that value.
So I just take another variable as a value.
And then with this I define as a get our attribute.
So this great attribute here, I have to defend myself and then our Phelim, that means this field them.
So here with this is shall we check?
Every field is empty or not.
So for the reasons here, we have to define that condition.
If our this fellow.
OK, that means here I define all that our field and if our D value is known.
OK, so here I define unknown or empty.
So that means the value will be as equal, equal, empty.
So shall we check it.
So if it's empty or if it's not, then it should be done.
OK, so this already seems to be then it will be redone.
So shall we return the false.
It shall be done the false and then it will be written.
True.
OK, that means the return.
True.
So then we ran through, so I hope you can well understand about it, friend.
What exactly did things I did on here?
So with this full name, I get all the data that this all that awful, that I get that things with this
variable.
And after that I just simply define on the forehead.
OK, so you do the for loop here.
We have to define that singular in our plural Unnim.
That means this one.
So what regions here are defined that name as names and that is our names.
So whatever the name you actually call on here, if you just make the things as a name, OK, if you
want to change it only that name, then you can change it and you have to then pass it in our DL failure.
So here to help to pass it.
So right now it's OK with me.
So I just simply defined that name as a name and that names and then our value will be our guest attribute
with this great attribute.
I just simply defined that field, that all that Orefield and then I define that condition.
If our disvalue that means here I get all that awful data.
And with this I take the things with this variable and now I dissembler define that condition.
If our value is Nonno or if this value is empty, OK, then it should be returned our false rather than
it should be returned.
That true.
Perfect.
And also for this one, that means building up this feel here.
I want to do want to create one of the master class that the class class matter.
So here I define that class met with this class material when we actually on this issue will be created.
One the plural.
Right.
That we are building at this plural.
So if you want to make the things as a parallel to the singular, then what exactly you have to do to
have also one of the functions I have already discussed about the things we do that is actually the
most temporal.
So I just name it as a verbose, underscore name, underscore plural.
So we have use it for our category actually.
So no, I don't want to use it for this building addressed.
That will be actually the different message.
It will be as a billing address.
OK, so this step up, one of the name which we display as a billing addresses.
OK, address this.
So this table, one of the name is salvageable here.
We have created one of the class that is are building up this class and that is all that are filled.
So now we have to do we have to migrated.
Right.
That means this model down to magnate's.
If you migrated, if you click the save all site assembly definers to save all.
So you can see it's not showing some that or, you know, are you worried by that is are from Django,
you all input, but that means that is you know what else that means in our opinion, Wardell.
So this check this out, what exactly the things I did wrong here.
So it's actually getting one of these.
You can see that is actually one of these piso.
But I just simply in that space and now click the save all.
And also getting another space's so there is another space, as I have defined another space better
and that we're going to save all.
Yeah, you can see it's not perfect, so no one to do it on that missile onto my guitar double bass
that I have created so that our billing address.
So now here I want to run it.
So here that is our buy and then manners and then make migration's, make migration's and then our application
name will be as an underscore payment.
OK, app on risk of payment.
We try to minimize it to bit.
So you can see that is actually our manners by manners, by and make migration's and the app payments
are now under control.
It.
So now he's not creating our model as a billing address, right, and now after that, I want to do
want to create as a buy and then manor's.
Not by and that my grade I just named as a PI madness by and the magnetic enter.
Yeah, everything is no perfect running.
Perfect.
So now we have to do we have to visibly tried.
So we have to visible our all that field.
So we have to visible all that field in our pace.
So if you want to visible it then we have to do it to create one of the forms for this one cenote app,
payments to get around to do and to create new file.
And I just name it as a form.
OK, just name it as a form dot fight.
So into this form.
That's why here I want to define all that our field.
So here, first of all, we have to do we have to take our from Django.
That means our Django form.
We have to import input form.
So I just simplified our forms and then our from our opponents, from one apartment that is our models.
Right.
There is our models.
Sorry.
So from the model I want to do and import, I have created onto the model in our appartement, into
the model area.
I have created that model name as a class name as a billing address.
So no, I just simply import our billing at right.
And now I want to define our form.
So I want the class so into the class.
I just name it as a building form.
OK, so this type of one of the name I have defined and it will be in our form, that means our building
forms and also it will be added in our model form.
So to simplify the model and then form Redfearn and then I have to do sorry then I have to do I have
to define that our middle class status symbol definition class Metuh and the displacement area.
I defined that our model, our model will be as if this one that means the building at this stage simply
defined as the building address.
And also here we have to define all that our field which really want to displace.
I just simply defined as a field.
Our fields will be here.
I want to do able to display all that field, actually.
So here I have created as you address.
So I just simply defined that as address.
And then also I want to display our zip code density and the country.
So I just simply defined the zip code and then the city and then also the country.
I just defended country.
Perfect, right.
So now I just came as a Savol.
So now if you want to visit all this form, then we have to do we have to create one of the few.
Right.
That within our apartment in the video we have to create on The View so we can do that work better and
to continue this process, you know, next video, I will show that things with a live example.
So thanks for watching.
I'll see you in the next video.