Hello, friend will come back in a previous video, we have created some the class right here, we have
created all the class as it user and also we have created the class as a mieux, our manager.
So now I want to do for our e-commerce project that the user profile is so much important on the part
and indeed the user profile here.
I want to do want to define some of the multiple feel for our user.
So for the business here, I wanted to create another class, OK, and want to create another class
and I just name it as a profile.
And if the profile, it will be integrated with our models, OK, with the models and it'll be also
that model.
OK, so then the model and also after that we have to we have to define our all the fields.
So first of all here and order to define the user.
And with this user here I want to define that will be as a model.
This will be just like the same before here.
I want to create one of the relation as a one to one Felician,
OK, one to one relation.
And with this one to unfilial relation here will be our user and the user.
I want to define it on the left.
On the left.
So that will do is to be just like the same before we have already did the labor work all of the time.
So on the lectures will be on the left with the models and then I want to make that as a cascade.
And then I also want to define that one of the relation.
So here I have to define the relation name with the related name, work related underscore name, and
I just name that as a profile.
OK, just name it as the profile and no one else wants to do and define some of the feel for this user
as a user name.
OK, username fill will be created with these models.
So this model, it will be as a character filter.
OK, so we have the character field and with this character we like to find one of the attributes of
the maximum.
So I just simply defend the maximum talent.
Maximum length will be to 64.
And also I want to do and make as a blank blank as a through and then also in order to undertake another
one for our full name, again, this user full name.
And here with these models.
So this model and the different, the character field.
So character feel also here I want to define what the maximum length, maximum length will be, the
264.
OK, and then also I want to make that as a blank blank will be added through and then also and we need
that address because that is actually the e-commerce site.
So for the e-commerce site, we need to know that there's a difference, that just one would be the
models.
So this model will be the TextField OK field, so it'll be the TextField.
And for the text file, I want to define the maximum all of the attributes as the maximum limit to maximum
for the text field.
I want to define of the 300 character.
OK, and also here I want to do and to make that blank.
And black will be the true.
And then also we need the city and city will be with these models.
OK.
Sorry.
So this model, this will be also the character filled character field and then the maximum land mass
for the city.
I define the maximum length will be as 40 character.
And I'll make that as a blank
blank as a true.
And then our another field I want to define as a zip code, OK, zip code with these models.
So this models I want to do and do find that this will be also the character field.
OK, sorry, CAGR character field.
And then I define the maximum length.
Maximum length will be four zip code.
I define as a ten.
OK then will be enough and I just simply defend the blank and blank will be the true.
And then I define another one as a country country will be are the models then correct a field and then
maximum length sorry, maximum playing for the country.
I defended the 20 and make that blank.
Blank is equal to true.
OK, blank as were true.
And also I don't want to take that our phone number.
That means the phone with sorry.
With the models.
I want to find the character field character field and then maximum length and far form maximum length
will be the 20 and also make as a blank like a blank will be as a true and then the date of joining.
So I just simply give the date underscored giant dead giant.
And here with these models, with this model, this will be a table where the date time field.
The time feels right so that it will be the day time field and then it will be as an auto auto now and
underscore at and then it shall be true.
And after that, I want to do the function.
So here I want to do and the final days of this to function as a day of the double and the line is train
and here will be the self.
And then here I want to do in order to find the return route and our user name with the self.
I defended the user name, OK, and use user name after that user name.
I want to define who shall be displayed as a user name is profile.
OK, so here after that user name I want to define it.
Plus it shall be ad as opposed to.
OK, so here it is with this type of one of the picks that in the profile that means if you define as
the audience then it should be defined as the audience profile.
OK, so this step up of the Texas will be added after this user name and then on want one to define
another functionality because first of all, here we have to do have to check all that our field.
Right.
So here, if you want to check that field, then also you have to have a different function.
So here I want to create all the function and I just name each of these underscore for field.
OK, so here I want to do first of all, check that field is already fully fulfilled or not.
So here I take one of the function name, whatever the name you are choosing.
So that is actually customized function.
So now I want to create this function with the self and here with the self.
So I take on the variable as a field name.
OK, fields under a name.
I just take one of the variables with this variable.
I want to first of all, check all that our field.
So if you want to check if such a simple defined field and the name and therefore if sorry if in the
self so the self you have to define that underscore metal a metal with this metal you have to get your
filename.
So here I just simply want to get all that feel.
That is a good underscore field.
OK, field.
So here you have to defining it.
So that is also not the building function.
So I just take a picture.
First of all, check all the tower profile field and I just take that all field with this variable.
That means that this variable so no one to do and to check this condition, if this field is already
filled up, then it should be shown as a true then it should be sure as a false.
OK, see here after this.
So after this I wanted to undertake I wanted the for loop.
So just simply to follow and follow up here, I want to define that name as a field field and rescan
name in fields.
OK, feels under its own name because of all here, I have already get all that our check that is here,
I already check all that feed and take the things with this variable to note here, I just ran all the
for up for the follow.
The reader feels I just name it with feeling them.
So with this feeling them, I want to do want to check it.
OK.
So here I want to do want to check every field.
So here after this I find that value so into the value area.
I want to define of another function as a great attribute.
So I just simply defines a good attribute with this great attribute.
It should be the self and then our this name.
That means our field names are just simply defined the film.
And if that is if our this value is not known.
So the value is not.
So here I define the non are value value equally empty.
OK, so then it shall be done return as a false false and then it shall be returned to our true.
OK, so just simply improve and return.
True.
And now after that we have to do we have to define this step up of the things like when our this user
will be created automatically will be created.
Another object for our D profile.
OK, that means here that all the profiles automatically when this user will be created our D profile,
all the file will be created.
So if you want to do that work, then there have also solved the class we have to import.
So after this here.
But I want to read some of the comments for you.
OK.
So here I define defended.
It should be either to automatically.
Create one to one object.
OK, so it'll be paid on to an object.
So for now, we're going to, of course, forget it.
So from our Django, from the Django DBI and then models.
So from here, there is also the another one as a single model.
And then also the other one of the signals with the signals here.
I don't want to import our post underscore safe.
So that is of that object function.
So here you have to take it.
And also from Django, from Django.
There is also another one of the dispatch, S.H. Dispatch.
Right, dispatch.
But this is perfect.
So do the dispatch down to also import the receiver.
So just simply add I import our receiver.
So now with this receivers.
OK, so this is where we have to defining it.
So after this here, first of all, we have to define our DDC words.
So with these receivers, first of all, I want to do when this user is already said this data, then
it should be sense of the signal.
OK, so here with this post, that is with this post save, we can send this information so there is
a sender.
So the sender will be able to use it.
Right.
So when this end user will be created, the initial Besançon, the request or some of the message that
he created one of the user.
So when this user will be created, then I want to do the function as a create profile, create a profile
that means in this user saying that information that the user is created then our function.
That means our D profile function will be activated.
OK, so you do this profile function here.
We have to do have to pass that sender.
And then also we have to define that.
In a sense that means our instant and also now it will be created our profile.
So here I have to do that well-defined, that created OK, the same paths that created.
And also here we have to pass our key argument.
So here defined as the key argument, OK, argument.
And now I have to do I have to define our the condition.
I just simply leave.
This user is created.
OK, that means if this is actually the created, then it shall be created one of the profile objects.
So here I define that profile.
So there is a profile that means I have already defined our class.
That is our profile class.
That means our profile object that I have already created.
So that is our profile.
So that is our profile, right?
So the profile you should be now getting, that data, that is all that objects are here.
I just simply defining the profile and with this profile objects, OK, with these objects.
And here we have to define that create, then create.
And here we have to parse out how to use a.
So I just simply pass our user in a stance, OK, user instance.
And also here when this will be done then I don't want to define our save all the data into the profile
area.
So I think you will understand about it so that we saw in our this there will be created then automatically
if we send this request and then our D create profile function will be activated.
And also here I have to do I have to define another one so bitter I want to do a hundred different and
other function.
So here when this user will be send that request, I also want to do I want to pass out this all the
Tiensten data.
So here that is also all that fear will be activated and into this field area that we see in our profile
area.
I want to add all that, our field.
OK, so here, if you want to add it, then you have to define the function and just name it as a safe
that can save this profile.
OK, just symbol in front of the profile of the function.
And here also we have to parse that sender.
We have to parse that in a sense.
And here also we have to parse out our key argument.
So just simply define our key argument.
OK, so key arguments and now we have to do we have to now save this data.
So here at the front of the instance.
So with this in Austin, I want to define our this here, I define that user right into this user area,
we have to save all the data.
So he defined that name as a related name with the profile.
So here with this in a stand, you have to parse the profile and this profile, the time to save.
So here I just simply say it.
So that's all we have to do.
So here I have created some of the class.
So that is a profile class.
I have played around in that class as a user and also that is our might user manager.
So now we are ready to migrate to before migrated.
We have to do we have to register all that our class in our admin.
Right.
So better able to do and to continue this process, you know, next video will register all the class
in our admin and after that will make it OK.
So we will migrate and access our admin.
Then every functionality will be very much to you.
So thanks for watching and I'll see you in the next video.