Hello, friend.
Welcome back.
In this video, I will show you how you can create some of the custom filter for your project for doing
this.
First of all, we have to do we have to create one of the folder in our first application, in the first
application here.
And we want to create on the folder.
And I just name it as a whatever he wants.
Right now, I'm named as a template text.
I just name it as a template text.
So I just create this folder so you can select the folder into this folder area I want to do and to
create to file.
First of all, I want to create one of the file for our filter as a my underscore filters, OK, I just
name it my underscore filters dot file.
So that is my underscore filters, dot fi and also I want to create another init fight.
You can see they have also by default one of the init file.
So now I have to do one to create another.
I need fi, you know what this project area.
So that was in all this folder area.
So here will be DoubleLine that I will underscore and then that in it.
OK, and then also again that will underscore and then the file.
So you have to create it.
So to simply create that things on here.
So now here we do need this here.
I only want to create and then ignore my filter area.
That is my filter by area.
So right now we don't need these pages.
HTML also we don't need this.
OK, so here first of all, I did want to import our building one of the template functions, so I want
to do and defining it as a form.
So here I defined the form and then Django then the import.
I want to import the template, ok, I just import the template and then you have to write down at the
register so that the register and then here you have to define with this template, OK, with this template
you have to define that as your library means the template library.
So just simply defined the template library.
And after that I want to do for my filters, I want to create one of the function.
So if you want to create that function, what exactly have to do?
We have to define the Jeev and that I want to do and define the function name as a my filter, OK,
I name it as my filter and here I define some of the value.
OK, I take what the parameter as a value.
So with this value you can actually return some of the value.
Like I show you I the simply defined the return and then sorry return and the value of this value.
I want to add some of that and that data.
So first of all, let's be sure our D value into this value is, shall we add, with the other extreme
data.
So I just simply defined the listing data as like this is sorry, this is a start starting from a stone
filter.
OK, so this step up, one of the text I have to define and then also I define our all that like really
in our register.
Right.
So into the register area.
Sorry.
So that is actually the register, so into this register area, you have to define your filter and into
this filter you have to define your idea, what that means for this filter.
I want to do this.
If you want to display this filter to another area, then you have to defend the things with the sound,
the idea.
Right.
So I just simply developed the idea as a custom.
OK, I name it as a custom underscore filter.
I name it as a custom filter.
And then here I have defining what this value and that is with this function, I simply define our dysfunctionally.
OK, I just simply define this function.
So now here, what exactly you want to display.
OK, so now you can display your this custom.
They have some of the value you can displayed with this idea and also that reservoir, my filter.
So here I have created this function.
So now right now I want to go on to a fully displayed in our template index.
That means here.
So here I have defined already that our sample takes right into the view here in the View area I have
defined that sample takes a bit to do and define some of the text on here.
OK, I just simply defined some of the text as a sample sample text.
So this step up one of the text I want to visible, OK, and then it shall be displayed the simple text
on here.
So first of all, if you want to display it, you have to do you have to load your this filter.
OK, that means this function as my filter.
You have to load it.
So that is our base into the our fast step into the step area.
I have defined this page as my filter.
Right.
So first of all, you have to load it.
So after this extent, OK, after this extent here I want to do and to load this with double percentages
and then I want to load unload our my underscore filter filters.
OK, that means that with our filters I just simply defined the my and then filters.
So now I just simply remove it here.
I want to display our custom field.
So right now if you save it so you have to save it fast and after that you have to run your server again.
So just simply remove it.
And when you run automatically, lives will be created.
One of the items folder in particular, that area.
OK, you can see it's already created on the folder like here.
I just ran our server again as a python and that man is dot fi and the run server.
So I just simply ignored Starbursts.
Now, if you go and if you refresh it and now showing as a context must be destroyed and then said so
maybe I did something wrong.
So the sample takes in our view here that your sample text idea here, you can say just Defendor command,
which will be as a clone.
So there is a sample size to simply defend our sample text will be as a sample text into that index
here.
I have defining it.
Right.
So that is our sample text.
So now let's check this out again.
I just because I evil all.
So they have some of the silly mistake I define as a comma shall be as a clone, right?
So now I just simply define you can say is now running.
Refresh it.
Yeah.
Nagasu snowshoeing as a sample text.
OK, so now what do I want to add our custom idea that means custom filter I have created.
So here I have created our custom filter as a custom filter idea that there are custom filter.
I just simply copied no index.
So after this I want to use it.
So you have to use it with the pipeline.
And then I define our custom filter name as a custom filter.
So into the custom filter, I have defined our disvalue.
Right?
That means automatically, first of all, you will be display our value.
That means our keyword that have defined the text.
And after that it shall be added value.
OK, so now let's check this out.
If you nucleases save all.
So now if you refresh it.
Yes, no different now showing as a sample text.
And after that here I have created all of the custom filter and we discussed on filter.
I display some of the value.
OK, so now we can successfully created one of the filters.
So that is our custom filter template text area.
So with this you can actually create it.
So that is how that is a clever idea.
This idea have parsed so that they are custom filter in index.
After that I just simply define our filter name.
Perfect.
So now you can see after that is added our this filter name.
So friend that's all actually the basic.
So when will you use it in our pulisic then.
It'll be much more clear to you in your next video.
I'll start a new session is about that.
How can the court application with using that MySQL.
So as I told you before, so that is actually Django by default.
All the admin panel that means by Django by default on the database.
Right.
So now I want to do to create one of the court applications that Misho can create data, how can read
data, how can insert data and how can direct data and update data so that the court applications can
create the good application with using that MySQL.
In our next video, I will show you that things with a live example.
So thanks for watching.
I will see you in the next video.