Hello, friend, welcome back.
In a previous video I have already discussed about the things, our view of the model, so now we will
create it.
OK, so now we will create all the models.
Right now we don't need this.
I just simply remove it from here.
So not only do I want to create on the table and also for this table, I want to define some of the
field.
So if you want to create it, first of all, you have to define that class size or simply define the
class.
And I want to do and to create one of the class name as a musician.
OK, and into this musician, I just simply defined as a model that means our model slavery.
So I just simply defined model and into this model slavery.
I don't need to create one of the model class.
So I just simply defined as a model, OK, just simply defined as a model.
So now I want to do and define our field like here for the musician pibil.
I want to define some of the fast name fast and that is the name of the field.
And then with this model slavery.
So with this model slavery, I want to define some of the type like here I define as a character type,
OK?
Just simply defined as the character field type and for the character filtered by defined as a maximum
length.
OK, this simply defined as character and character, and I just simply defined for this field as a
real good friend and also I want to create another field so better I just compete.
I want to create three field.
One will be as a first name, one will be as a last name.
So I just simply defined the last name.
And with these models, that means that is our model.
So I really would do this model.
I want to access our one of the type as a character field type.
And for this field, I also want to define that Maximilien will be as a 50 and also on the define another
field and this field will be the instrument.
I just name it as an instrument, and with this model, I also do find the type will be as a character
field type.
And here I define that maximum length as a one hundred character.
So I just simply defined as the one that character and also I want to do to create another class.
So I just simply defined the class.
So I just simply defended the class.
And here I defend the class name of the album.
I just simply name it as the album and it'll be just like the same.
Our models slavery seemed to this modern slavery.
I want to express our one of the inherited with our model class.
I just simply defined as a model class.
OK, and now for this one, I want to do want to define one of the field and this field name.
I just simply defined that name as the artist.
OK, just name it as the artist.
And with this model models and with this model, I want to call the foreign key.
OK, just name it as one of the foreign key, and I don't appreciate all of the foreign key of far out
this musician will say, just simply defending it.
And also here, I want to share that one.
Things we do by default, when you actually ranie by default, this Jianguo automatically created the
idea.
So here you don't need to create it like here automatically.
So be created one of the field as the idea.
And for this idea it will be defined in the models.
OK, that means with these models automatically it will be defined as auto implemented.
That means the auto field, OK, auto field and also should be defined as the primary.
Primary underscore key and also will be the true so automatically by default, this Jianguo automatically
created this type of one of the.
So that is actually by default, thinks the hair is hidden.
So here, if you don't want to use it, then you don't need to use it.
OK, so here automatically all the hidden in the field is created for a particular that.
Jianguo So for the reasons here we don't need to defining it.
So here I define as a foreign key into the foreign key.
I want to create one of the foreign keys for our.
This means that this mediation table so automatically it should be connected with this hidden I.D. So
here I define as a musician and also I want to do and define the own dialect.
OK, I simply dependence on the left and with these models.
OK, so with these models, I want to define my weapons as a cascade.
That means if any musician have any album in particular, that position if you want to, so you cannot
elected directly for the reasons here.
I just simply defined as a cascade.
And also after that I want to do undertake another filename.
So I just simply define that another filename will be as a name.
And then with these models and with this model, I want to define the type as a characterful type
character freaked out.
And for this character will die by the simply defined the max maximum land sorry, maximum land I want
to define for this one.
That means the name as a one hundred character and also had to do under defined the field as a relisted
release.
Underscore dates of everything is step by step.
Everything will be very much clear to you.
OK, so don't worry about it.
I just simply defendor another field as a release date and for the release date to have also another
type as a data type.
So everything is our in our model with this I just simply defined as a models into this models.
I want to define another type as a type.
I guess I just simply defined as a date field site to simply define the date field, OK, and also undertake
another field for that.
ARMBRISTER Such as simply defined as the no underscore.
Ister OK, no it starts.
And then with this model, with these models, I want to make the things as a desert field.
OK, just name it as Intisar feel for this one, perfect.
So here I have created two of this class.
One is a musician class and for the musician class, they have the three feel.
And also that is our middle class.
I have defined as the album.
And for this album I have defined that our forcefield.
Right.
So that will be our farfield.
And also that will do it here.
Also, they have all the follow on the hidden field where I want to add that things for you like here
it will be also honored that he didn't feel as the idea.
And then with these models that have all also one of the divers or Tuffield, OK, Autofill, and then
you should be at the primary.
So it will be the primary key and then you will be the truth.
So he had this step up, one of the hidden field already added on here.
So better had to do and to make the things that are not OK.
So that is by default one of the things and also for this table, that means for this class also, there
have also been other idee, in particular that area.
So here you don't need to add this idea.
If he didn't know the is automatically created.
So you don't need to worry about it.
And after that, we have to do we have to run three.
Come on.
OK, so now, first of all, I want to do and say, wait, so I just got to save all and on our project.
So here I open our terminal into this terminal.
So that is actually our in particular that position.
So that is on my passport.
Right.
So now here you first of all, you have to make if you want to make the deal.
They have also of the commanders, a python python man is with this man is.
Everything we have to actually call it with our Manase fight scene with the Python and menace fight,
then I want to do migrated to simply defined as a python menace fly and the market so no one to do and
to make their destabilizing effect because they enter.
So here they have solved the arrow is a class musician, so, you know, on line five.
That is our unexpected indents.
Maybe they have some spaces which I just removed that space.
Also, I just hope that Espace.
OK, and now let's check this out.
Just click on the Save All I will say.
Well again.
And now that's all I want to do and actually run it again.
OK, so I to run it again as a PSP banners start fight and my great Kilcunda and.
Yes, now that have actually sound the you here, so now it's migrating all that file successfully and
after that also you have to run our another course here.
We have to run as a python python and then Manny's Manny's Dot Fye.
And this man is Dumphy here.
We had to make that our migration status simply defined as to make migration migrations sorry, I actually
praised that and so defined as a python and then Manna's Lotfy and that make migration can migrations
and then our name.
That means our app name.
So our app name is our first app here you can see.
And I put some of this spelling mistake as a fast if I may.
So now it's OK with me.
So I want to do and to define our app name.
So our name as a fast if I fsd underscore app.
So here I have to define our application names.
So that is a common python.
Manase fly and make migration's ok, make migration's and then our fast app.
So now I just click the enter.
So now here you can see it's not created that model as a musician model and also created another model
as the album.
So here I have created two of this class.
One is the musician.
Another is the album.
So it's not perfectly clear that to have this model.
So after that, we have to do we have to run again.
We have to migrate it again.
So if you want to migrate with the same python python and the Manny's Manny's dog fight and then migrate,
so are simply defined as a python managed Lotfy and a my good friend every time whatever that you Jameses
in particular, that model Sadiya.
Every time you have to run this record, one will be as a python.
It's fired up like that.
And after that, the python, Manase Fi and the migration's and then Fastweb.
And after that again, you have to run that python minus Fi and the Meklit like a friend.
So every time one of the things you will change in particular that position.
So every time you have to run this trick or so now under do under the enter.
So now everything is not perfectly OK.
That means we successfully create our database and the database, we successfully created our tour of
this model.
So that is our bootable as a musician to be on the album table.
So, you know, next video I want to do, I have already created to this model as a musician and the
album.
Now, if you want to insert some of the data in particular, that musician that feel that first name,
the last name and the instrument field, so I can add this object into this table in our next video,
I will show you that things with a live example.
So thanks for watching and I'll see you in the next video.