1 00:00:00,150 --> 00:00:07,880 But today, we are going to create a different instance of how we can create a separate file phone file 2 00:00:08,040 --> 00:00:14,700 and we can store all the forms in that file and we can render the phone whenever required, whenever 3 00:00:14,700 --> 00:00:18,610 required, without writing the repetition of the code. 4 00:00:18,810 --> 00:00:25,620 So that brings some kind of an alternative solution, how we can create a phone and how we can submit 5 00:00:25,620 --> 00:00:25,900 them. 6 00:00:26,250 --> 00:00:28,280 So let's get started with this. 7 00:00:28,290 --> 00:00:33,570 So I have two links so you can have a look at these links. 8 00:00:33,930 --> 00:00:38,460 So I've opened the links on my browser as the first one is this. 9 00:00:39,240 --> 00:00:43,940 So today the we are basically going to work in something this kind. 10 00:00:44,010 --> 00:00:45,840 We are going to create a form in this search. 11 00:00:45,890 --> 00:00:54,240 We have defined below how we can fetch the data from the phone to remove the special characters, any 12 00:00:54,570 --> 00:01:01,520 special characters and widgets in the form so that basically there are different types of widgets once 13 00:01:01,530 --> 00:01:08,110 it takes import number and put them in your password and an important day to day time time and put text 14 00:01:08,160 --> 00:01:12,120 area, then some other also checkbox radius. 15 00:01:12,540 --> 00:01:13,890 So there are five input. 16 00:01:14,100 --> 00:01:23,010 So there's some like many options in the form and how you can render the form on the front end part 17 00:01:23,010 --> 00:01:24,070 using it today. 18 00:01:24,210 --> 00:01:26,870 They're going to work with a different solution. 19 00:01:27,330 --> 00:01:29,430 So let's get started with this. 20 00:01:29,670 --> 00:01:34,770 So what we do I have a quick recap of the last picture. 21 00:01:35,400 --> 00:01:39,320 Like we lost, I open my file unstoppably file. 22 00:01:39,810 --> 00:01:46,980 So like in the previous tutorial, I showed you that do you want to enter the form that was my form 23 00:01:47,340 --> 00:01:50,070 and another one somewhere in the form. 24 00:01:50,250 --> 00:01:54,040 So, well, I used to render a form using my file. 25 00:01:54,060 --> 00:02:00,760 Then I used to submit that form and we used to move to this year and then we used it. 26 00:02:00,990 --> 00:02:02,790 Then we had our back in logic. 27 00:02:02,790 --> 00:02:06,690 Then we we can process the form data at this. 28 00:02:06,690 --> 00:02:07,630 You are OK. 29 00:02:08,340 --> 00:02:15,240 So today what we are going to do, we are only going to create a new one here and will only go to one 30 00:02:15,240 --> 00:02:21,740 year are and work with in such a way that it will help us out to do both things. 31 00:02:21,880 --> 00:02:23,770 So first what I do. 32 00:02:24,240 --> 00:02:25,610 OK, ok. 33 00:02:25,620 --> 00:02:27,420 And create a euro. 34 00:02:27,900 --> 00:02:31,650 But I define my form. 35 00:02:32,670 --> 00:02:35,790 Do I call a view function. 36 00:02:35,790 --> 00:02:38,970 You start my form to. 37 00:02:40,510 --> 00:02:42,220 And I'll define a name to it. 38 00:02:42,640 --> 00:02:47,050 Name is equal to my full two. 39 00:02:47,330 --> 00:02:52,750 OK, so I define find this in such a way that you don't get confused with the previous one. 40 00:02:52,780 --> 00:02:55,200 So today we are going to work with my full two. 41 00:02:55,360 --> 00:02:57,970 OK, know what I was going to do. 42 00:02:58,390 --> 00:03:00,700 OK, this is my app file. 43 00:03:01,750 --> 00:03:02,860 Inside my cab. 44 00:03:03,100 --> 00:03:08,650 I create a new file with the name Foam's Dot. 45 00:03:10,230 --> 00:03:10,560 OK. 46 00:03:11,600 --> 00:03:19,900 So this looks pretty fine and what we are going to do, so I'm inside my films, my file, and I move 47 00:03:19,940 --> 00:03:20,690 to this link. 48 00:03:20,960 --> 00:03:28,580 OK, so today, the very first line you need to tape is from Django Import Forms. 49 00:03:28,610 --> 00:03:38,300 OK, so what you need to do from Django import forms. 50 00:03:41,030 --> 00:03:50,210 OK, so why I'm doing this, I will this will help and I would run my silver python manage, not be 51 00:03:50,210 --> 00:03:51,770 white run. 52 00:03:52,130 --> 00:03:56,630 So so this would help me to know if there's any such error. 53 00:03:56,660 --> 00:03:58,270 OK, so tell me. 54 00:03:58,670 --> 00:04:06,710 OK, so from Chanko import forms, I know you create a class for your form which will define highly 55 00:04:06,710 --> 00:04:12,170 creative class class isela to feed back. 56 00:04:15,020 --> 00:04:16,160 The feedback form. 57 00:04:16,430 --> 00:04:26,620 OK, I have a small v. sorry feedback form, and what I'm going to do, I'm going to do forms dot form. 58 00:04:27,410 --> 00:04:30,170 OK, so this is a syntax you need to follow. 59 00:04:30,290 --> 00:04:32,300 OK, now you're done with this. 60 00:04:32,360 --> 00:04:34,430 OK, now I'll define two things here. 61 00:04:36,500 --> 00:04:37,670 One is the title. 62 00:04:41,070 --> 00:04:50,980 OK, and another one, a subject, OK, so I'm going to define and what I'm going to do, I create I 63 00:04:50,990 --> 00:05:01,900 coffee since foam's don't care field feel OK, I don't care. 64 00:05:01,950 --> 00:05:04,040 Feel that this was pretty fine. 65 00:05:04,890 --> 00:05:11,970 OK, I've defined to canefields here so I'll give a name, I'll give a label with the max length I define 66 00:05:12,990 --> 00:05:15,450 the label is equal to. 67 00:05:16,500 --> 00:05:17,080 Tighter. 68 00:05:18,330 --> 00:05:24,630 OK, now this fight label is equal to. 69 00:05:26,180 --> 00:05:28,160 Well, we can call it a subject. 70 00:05:32,140 --> 00:05:32,980 Description, 71 00:05:36,640 --> 00:05:47,410 description, subject, description, and I'll find a max scope length is equal to 50 for this and in 72 00:05:47,410 --> 00:05:49,870 the same way I define. 73 00:05:52,250 --> 00:05:55,210 Max Cleland is one to 200 for this. 74 00:05:55,460 --> 00:05:59,380 OK, you know what I'm going to do? 75 00:05:59,390 --> 00:06:02,400 I'm also going to add a different attribute here. 76 00:06:02,470 --> 00:06:09,680 Here you can see that I can also define which it is able to form input. 77 00:06:09,920 --> 00:06:13,490 OK, so I'll copy this. 78 00:06:14,540 --> 00:06:17,260 And in this way, you're going to X and put it. 79 00:06:17,360 --> 00:06:17,960 But this. 80 00:06:20,740 --> 00:06:25,180 And for this one, what I do, I change to a text area. 81 00:06:26,700 --> 00:06:30,430 OK, so if I'm not wrong, I'm great with the spelling. 82 00:06:30,710 --> 00:06:31,400 Look at this. 83 00:06:31,400 --> 00:06:32,940 This text area right here. 84 00:06:32,950 --> 00:06:35,000 You can see this is dictated the state's input. 85 00:06:35,070 --> 00:06:38,450 OK, so I have created the form successfully. 86 00:06:38,890 --> 00:06:41,700 So this is the form. 87 00:06:42,580 --> 00:06:43,840 What are you going to do from January? 88 00:06:43,840 --> 00:06:49,420 Platforms, class feedback, form forms or form the deiter with the both of them having a label of the 89 00:06:49,420 --> 00:06:53,860 subject being the text input and the text respectively. 90 00:06:54,500 --> 00:07:00,150 Now, I moved when you started the fight and I will define. 91 00:07:00,150 --> 00:07:00,700 Define. 92 00:07:01,720 --> 00:07:08,860 My phone, too, will make a request as a barometer. 93 00:07:10,040 --> 00:07:16,950 And before using this what I do, I die from DOT forms. 94 00:07:18,400 --> 00:07:27,310 So basically I'm referring to this file from form Shopify import star so you can import every form you 95 00:07:27,310 --> 00:07:27,610 want. 96 00:07:27,610 --> 00:07:34,430 OK, know what I'm going to do and put the if condition, if requests. 97 00:07:35,050 --> 00:07:40,810 Dark matter is equal to post. 98 00:07:42,590 --> 00:07:51,730 OK, and just with the basic understanding I'm doing this to question method, is it going to get so 99 00:07:51,850 --> 00:07:56,360 for the same role we are going to check if it's a request method plus get a. 100 00:07:57,380 --> 00:08:07,550 OK, so if it was a cat matter, so what I'll do, I'll form a good form. 101 00:08:07,550 --> 00:08:12,200 And that form was this was the name of my phone feedback form. 102 00:08:12,230 --> 00:08:17,340 OK, so I have a feedback form on. 103 00:08:17,690 --> 00:08:23,540 OK, so basically this is equivalent to this. 104 00:08:23,730 --> 00:08:33,260 OK, so this is just for having just one and having this is equal to this and what I'm going to do now, 105 00:08:34,050 --> 00:08:42,830 I'll execute a pass statement in just I'm giving a statement then it doesn't human error and I have 106 00:08:42,830 --> 00:08:46,760 a form and what I do I don't render. 107 00:08:50,170 --> 00:08:50,980 Request. 108 00:08:53,210 --> 00:08:59,390 And helpful to find in my dictionary is able to form. 109 00:09:01,070 --> 00:09:02,810 OK, and I'll post this for. 110 00:09:04,820 --> 00:09:18,410 And I learned request and make up my phone to talk about Yemen and context is equal to my dictionary. 111 00:09:18,770 --> 00:09:21,360 OK, I'm sorry, I'm wrong with the syntax. 112 00:09:22,670 --> 00:09:23,630 No, this is fine. 113 00:09:24,140 --> 00:09:26,570 But right now I'm want to find my phone. 114 00:09:26,570 --> 00:09:27,700 Do not, Actimel. 115 00:09:27,890 --> 00:09:37,040 OK, so I'll go to my templates folder and create a new file on my phone to call FEMA. 116 00:09:38,110 --> 00:09:38,430 OK. 117 00:09:38,900 --> 00:09:44,540 Now why do I extend my template so I'll have any page. 118 00:09:45,650 --> 00:09:49,630 So suppose I have this is a second order statement. 119 00:09:49,640 --> 00:09:51,010 OK, I'll have this page. 120 00:09:51,800 --> 00:09:53,780 So basically right now what I'm doing. 121 00:09:58,920 --> 00:10:05,830 OK, so I changed the title, my phone to OK. 122 00:10:08,410 --> 00:10:10,330 What I do as grateful. 123 00:10:12,570 --> 00:10:21,660 Now, that's it, I'm grateful, I know what I'm going to do, basically, I had rendered the form, 124 00:10:22,110 --> 00:10:27,690 so just what I'm doing, I defined the logic when I get to the post method. 125 00:10:27,810 --> 00:10:29,760 So define my form, do so. 126 00:10:29,760 --> 00:10:33,650 If the request or method will post below, the final statement will define the logic. 127 00:10:33,660 --> 00:10:36,750 But if the method is, it will create the form. 128 00:10:37,090 --> 00:10:43,960 OK, we will get the form from that class and then we will render that form to my form to protect women 129 00:10:44,040 --> 00:10:45,030 using the dictionary. 130 00:10:45,540 --> 00:10:54,830 And now the same simply removed platform and simply typed form taught us under SCoPI. 131 00:10:55,800 --> 00:10:59,550 OK, so I started my server. 132 00:11:00,770 --> 00:11:03,410 Looking at this looks pretty fine, so this should work now. 133 00:11:04,460 --> 00:11:06,710 No, I'll go to my local post. 134 00:11:07,400 --> 00:11:11,270 So the server has started and I'll go to my phone to. 135 00:11:13,380 --> 00:11:20,910 Oh, no, you can see like the form has been made, so I didn't quite correct the record. 136 00:11:20,910 --> 00:11:25,260 So what I did, I used my phone should be my phone. 137 00:11:27,060 --> 00:11:28,860 I had to find the title and subject. 138 00:11:28,980 --> 00:11:33,780 I've already to find the text input as well as the text area. 139 00:11:34,350 --> 00:11:39,980 Then I went to my store by we thought we were fine if the request was kept. 140 00:11:40,350 --> 00:11:44,900 So I had initialized the form then I had rendered on the pitch, OK? 141 00:11:45,540 --> 00:11:54,510 And then when I went to my FEMA page that I had without writing the estimate, I was able to successfully 142 00:11:54,510 --> 00:11:59,760 add the form using the estimate of sorry, using this up by reading the phone book. 143 00:12:00,030 --> 00:12:01,620 So what you can see. 144 00:12:02,100 --> 00:12:05,240 So then the scope is as paragraphs. 145 00:12:05,430 --> 00:12:13,320 OK, so when, when I move to my page so I simply the click on control plus you. 146 00:12:13,600 --> 00:12:14,980 So this will give me this old school. 147 00:12:15,420 --> 00:12:21,580 So what you can see here, the form has paragraph, text p p p. 148 00:12:21,750 --> 00:12:25,020 OK, so this means for most rendered use in paragraphs. 149 00:12:25,050 --> 00:12:32,660 OK, now what you can do I will type form a stable form are stable. 150 00:12:33,150 --> 00:12:36,180 So when I move to my page. 151 00:12:37,820 --> 00:12:39,110 Now, here you can see. 152 00:12:40,650 --> 00:12:46,650 The phone has been rendered using a table, so table, row, table, heading table data, then table, 153 00:12:46,740 --> 00:12:47,610 respectively. 154 00:12:47,910 --> 00:12:49,580 OK, so this is right. 155 00:12:50,280 --> 00:12:53,960 OK, I assume this OK, this is here. 156 00:12:53,970 --> 00:12:56,810 You can see this had been rendered using a table, OK. 157 00:12:57,150 --> 00:13:02,720 And when I did form and as B so this first paragraph. 158 00:13:03,180 --> 00:13:06,730 So I'll also do this, refresh this page then control you. 159 00:13:07,380 --> 00:13:09,580 So here you can see this first paragraph. 160 00:13:09,660 --> 00:13:18,330 OK, you can see the paragraph and another also one you can do you can say for us the other. 161 00:13:18,570 --> 00:13:20,490 So this will give unordered list. 162 00:13:21,420 --> 00:13:27,720 So I'll refer this page so you can put it into an list. 163 00:13:28,050 --> 00:13:36,090 So I simply control plus you know, and you can see here you can see here's the form. 164 00:13:36,090 --> 00:13:36,480 Yes. 165 00:13:36,780 --> 00:13:37,440 Here's the form. 166 00:13:37,710 --> 00:13:43,800 You can see a list has been declared list list item list item when the form has been rendered using 167 00:13:43,800 --> 00:13:44,150 list. 168 00:13:44,610 --> 00:13:48,390 So in the next year or two we are going to continue with this. 169 00:13:48,600 --> 00:13:56,220 And then I will tell you the basic part where we if the request, have the post. 170 00:13:56,460 --> 00:14:01,000 So what I'm going to tell you is the full will be submitted on. 171 00:14:01,020 --> 00:14:02,420 So what would happen? 172 00:14:02,670 --> 00:14:08,850 So next, we would actually try to style up this form as well as how we can render the errors and how 173 00:14:08,850 --> 00:14:13,050 we can fix the clean data and how when you get to check the validity of the form. 174 00:14:13,320 --> 00:14:15,090 So this would help us really.