Hello, friend, welcome back.
In a previous video, we successfully complete our product, retail space, or right now I'm not logging
in here.
If you want to access this product, details now can see you cannot actually access it is because of
all here.
I have defined some of the condition without logging.
You cannot access our database.
So right now and don't actually and not defining like that, we for doing this, we have defined that
things in our app shop into the app shop.
If you go to that view and here you can see in our this glass that is our product details glass I have
used as a logging declared mixin right now and to do it fully and remove it.
OK, so right now I just simply we will be now if you look at the all and now if you refresh it.
Now, go to our space, yeah, you can see now you can actually access it, right?
So now you can actually access your every product details, that means that is all that productive,
the space.
So now I want to do want to work for our app to cut options.
Right now, if you want to add to cut this product, then it will be rejected to our current area.
So here I want to defining it so better.
Right now there's our admin.
I just bought our admin user name, email address and the password now to lock in with admin, OK,
because here we have we have to create some of the feel for this one Lochness refresh.
And I can see now I'm actually logged in.
So now here I want to do want to work for this order.
That area of reorder will be set up.
Right.
For the reasons here I want to do I want to create another another application that it'll be better
in another application area.
I want to save all that file.
OK, that is all that our card and that already looked at everything I want to save it for.
If you want to create it then I think you already know about it what exactly you have to do.
So right now, just close it and now open our terminal.
Enter the terminal.
I want to create another application.
I just made me do it by and then manage dot by.
So managed by and then, is that right, that is up and I want to create of the app as the app underscore
order so they step up on the name I have defined as the app order nonclinical to enter now concedes
it's created another application.
So that is our application.
I have created the app order.
So now also we have to do we have to add this airport in our main file.
That means, you know, our main file, the setting.
So here I want to run our server again.
So here I the front of the pie and the Mannus pie and then run server the enter.
Our servers are not running so now and want to add I want setting into the setting that is our install
apps.
Now I have created another application and I just simply save it.
So here I name it as an app underscore order.
So I just simply named the app order.
Right.
So now I just click get save.
And also I want to create one of the folder in our template area into the template area, the app blocking
the app shop so no one would want to create another folder and just name it as an app order with the
same name.
OK, just name it as an app order.
And also you have to do have to define what this you are.
So that means, you know, our main setting into the main sitting area.
That is our project area.
Go to our you what else.
And you all say, yeah, we have to define another part for this one.
So just simply define another part and it be at the shop.
OK, I just name it as a shop, whatever you want.
And also we have to include include our app order.
So I simply defined as an app that you are told that we have to do, we have to create one of the files
that you or else that means in our app orders here.
So here I create new file and as you what dogsbody.
Right.
So I simply created so into this you are Deloria.
You will be just like our before if you go my word app logging you.
All right.
Now I just simply copy everything OK.
I just simply copy everything.
And now you know what that means in our app order into the app order.
You are all here I guess.
So this will be from our January until we need our pop.
So right now I don't want to define any parts.
I just simply be and also in our from our app order, so used to be as an app order app order from the
DC area.
I want to import that views.
And then also I own the definition of the name.
I just name it as an app order.
OK, so now I just simply save it and now we have to do we have to create one of the model.
OK, so we have to create the model for this cardholders right now.
I just simply remove everything from here and now go to our app order into the app or the role models.
So by default that is our import, our model.
And I wanted to do undertake another one.
I take another one of the from at the Django.
So from the Django that is have gone into the confrere and we import one of the glass as a settings.
OK, just rename it as the settings on here.
So with this settings model actually it still will work for you users right now.
I have already some of that user in our database.
Right.
So now if you want to create any user that means in any customer want to purchase any polls, then it
will be created our new user, so all the user will be set up with our existing one.
So far, the agency had the design of the class.
There is a building on the class as a setting.
OK, so with these settings we can actually defending it.
And now in particular that area I wanted to create on the class.
So I just simply defined the class name.
I just name it as a card.
OK, so that is our class name and it will be inherited all models.
This will be just like the same.
And then our model site is simply define that model.
So now I want to do all.
Do we need our user?
Right.
So for the reasons here, I take one of the object of the user and here I have two different models.
And also here I defined that our one of the foreign key.
So just simplify the foreign key and into the foreign key area.
We have to define our existing all that our user.
So here I have defined population that is our settings.
So to the settings area we have to define as odd or underscore user underscore model.
So here we have two defining it and after that we have to define that our own dialect.
OK, so that will be as on dialect and then models, so on the models and then the cascade.
OK, so that is our own deluxe model and the cascade.
And also here I would define not the name I name as a relative.
That means our related name related underscore name and I just put that name as a car.
OK, so now I just simply defined as a card for this name.
So as I told different with this setting, we can actually access our previous all that our user data.
That means right now, whatever the user will be created automatically, it will be included that new
user, in particular, that area with the settings.
OK, so for the reasons here, I define it as a model, our foreign key, and that is our own DILEK
models, the Cascade and then already let the name I have defined as a card.
Perfect.
So now I don't want to define some of the field like here.
Also we need our item, right.
That means this product item also will be needed.
So this for this item, if you go to our.
Shock and redemption.
If you go to our models, so here I have already defined our all the products, right.
So with this product Sadiya, we will actually get our these product item for the reasons.
So you'll need this.
That means our product will be needed.
So here, first of all, I want to import it.
So just simply from the from that is in our app shop.
So there is an app shop, the models.
So from here on the ground to import our last name as a product.
Right.
So that is our.
Yeah.
That is actually our product plus.
So now I just simply find that our product.
So now with this we can actually access all that our product items for the business here.
Take one of the variable as an item.
OK, I just name it as an item.
And then with these models here also we have to define that for key.
So to simplify that, foreign gifts will be foreign to which they will easily find you with our products.
So to simply define that products and also it'll be just like the same as on the left.
On the left will be all the models and then Kaskade.
So that will be as a cascade.
And then also we have to define that's how the related name.
So here I don't want to add that them.
So here we don't need it actually.
So that is item.
I want to access it with our this product.
So there should be enough.
And now I also want to do want to take another some of the field like here after this our quantity will
be needed.
That means our product quantity side is simply defined as the quantity.
OK, I just name it as a quantity.
And then with these models I want to define the quantity will be as a desert field type.
So our type will be as the desert field.
Right.
That will be as a desert field.
And also I want to define the default value.
OK, default value I defined as a one.
And also I take another one for the.
So for the parties here, I want to do and define with our models and then we have to define our type
so that packages will be actually Doublemint.
I feel so it will be needed for our checkout base.
So I just simply defined as a boolean field.
OK, that will be as a boolean field.
And also here I want to make the things as a default.
So default will be as a false.
I just make that as a false.
And then also we need our creator did so just simply defined as a created.
And then with this models, this type will be as a date right that time field.
And here we will be as auto députés auto now add automatically to be created.
And I make that things as a true, relevant and also updated will be needed.
So I just simply defined as the updated.
So with this ablated here, I want to learn to differ with these models and the should be at the same
time field and here it will be as auto now, auto underscore now and here.
I want to learn to make that things as a true and No one to do and to defend our history.
So here I am to declare is with the function that is our still right.
So this will be the self.
And here I want to do and to define and calculate it as the return that I like here.
I want to return I want to return our two of these data.
I feel like here I want to edit our all that quantity.
Each will be automatically multiple with our products so that the return will want to define.
So here, if you enter defining it, you have to define that if OK, so here you have to define that
if and here in particular that position, you have to define themselves.
So with this self, I want to access our this quantity.
So that is not quantity, it will be multiple.
So I just simply defined as X and then hour multiple with out themselves, so multiple with ourselves
and then that is actually our item.
OK, so I just simply defined this item and also I want to create another one.
I create another as a function that is Dave and then I just name it as a total.
OK, why.
Actually I'm using it.
I show you why I'm actually using it, then it'll be very much clear to you.
So here it will be as a total amounts of the total amount I of the variable as the total.
And then we thought this self.
So with this self I want to access our item price.
That means this item here I have already defined on the foreign view with our products.
That means if we go to our products model into the products model here, you can see that our price
is right.
So here I am to excessive.
So if you want to access it, then you have to do we have to define that our this item.
So with this item I want to already Franchi with our products so into the product soundchecks this hour,
this price.
So that is actually our price.
So I just simply defined that item price and now it will be multiple, it'll be multiple with our self
and the self.
I have already defined our quantity, so this will be our quantity, OK.
And also if you want to display the total amount with the floor, then you can also defining it with
using that flot.
I just name it as a floating rescue total.
So that is a total and then our formate I want to formatted it.
So I have already discussed about that things with you.
That is our format and it will be displayed as a total.
So this total amount will be displayed as to the similar characters for the reasons here at the end
of this zero point two, if you happen to have perfect now and do understand it.
So I just done our this flawed total.
So that is our floor total.
I just simply don't let it mean sexually.
Now I want to explain it like here.
If you actually connected with our some of the product then it'll be easy to you understand.
Like here I will take one of the item.
I put that things are there some of the not for you like there is our item say just name it as item
one for item one product that have the some of the quantity.
So quantity it means actually the quantity I want to purchase and also for unique price for this product
as a 150.
Right.
So now I have to do I have to first of all defining it.
So whatever the quantity will be uploaded automatically.
It will be time for the reasons here you can certainly find that are quantity equal to our item.
That means whatever the quantity will be updated automatically will be updated in our quantity area.
OK, that means if you want to buy this product again, it will be at the four and that will be our
unique price for the specific this product.
Right.
Like here, if you define as a another one, I take another product as item.
I choose another item as item two.
And this item two product I want to buy as a five piece.
And for this product unique price, I just simply defined as I like the four hundred.
Right.
So this will be the four hundred.
So here I defined this condition with this self.
OK, so here I define the return our this quantity equal do with our item.
That is our item will be admitted in our this quantity area.
So that means this quantity area.
OK, and then after that I have defined another gatot also get total means automatically.
Shall we calculate calculated two of this like this price.
OK, that in this price and this quantity so far the results here have defined all of the variable,
the total.
And with this total I have defined our item price name.
That means that this lower item price each will be multiple, it will be multiple with our quantity.
That means that is three hundred three PS so automatically it will be as a like I just make that as
a two hundred.
OK, two hundred.
That means automatically it will be calculated with our quantity.
That means it should be defined that result as a six hundred.
Right.
So I hope you can well understand about it.
So with this function we have defined that part right.
So with this function we have defined it will be calculated.
That means usually multiple with our product quantity, with our product unique price, and then it
should be get that result.
So far, the results here return our floor total.
So this floor total will be our decision.
OK, like that is our four hundred five PS so it will be as a two thousand.
Right.
So it will be actually getting that data and calculated that, that on here.
So with this we can actually defining that part and also we need our another class, we need another
class for the order.
Right.
That is actually for our cart.
So now we have to do we have to defining our also another class as the order.
So I just simply defended the class so the class and I just name it as order.
OK, so now we have to create it.
That means these are the class.
So here should be our models.
So models and the model.
And now here we have two.
We have been defining all that our field to get for our order so we can do that work by trying to continue
this process.
You next video, I will show you that things with the living sample.
So thanks for watching and I'll see you in the next video.