1 00:00:00,060 --> 00:00:06,600 In this city, we are going to walk with the alert and Django form, so basically alert handling informs, 2 00:00:06,900 --> 00:00:11,250 so indisciplined we are going to handle alerts and Django, there are two types of alert. 3 00:00:11,730 --> 00:00:14,210 One is for error and there is success. 4 00:00:14,670 --> 00:00:16,200 So we will fill the form. 5 00:00:16,650 --> 00:00:21,980 So we will fill the form, we will fill form the real date and check on for both. 6 00:00:21,980 --> 00:00:25,660 The cases will track on the front end to render and display messages. 7 00:00:26,130 --> 00:00:27,720 So let's get started with this. 8 00:00:27,960 --> 00:00:30,600 So we had we had Maidenform. 9 00:00:30,930 --> 00:00:42,120 So this was our fault, OK, on the request method and on the basically here you can see on the request 10 00:00:42,360 --> 00:00:47,640 we used to render the form and the post requesting that you should submit the form so we would apply 11 00:00:47,640 --> 00:00:50,040 the error handling on the post method part. 12 00:00:50,520 --> 00:00:53,610 So basically before this, I will show you some process. 13 00:00:55,110 --> 00:00:58,290 The process here is about that we have on and bootstrap. 14 00:00:58,680 --> 00:01:08,160 So what we can see is not provide contextual feedback messages for a typical user actions with the handful 15 00:01:08,160 --> 00:01:10,340 of available unflexible alert messages. 16 00:01:10,830 --> 00:01:17,370 So there are basically many types of alert, but this is a primary alert, secondary success. 17 00:01:17,490 --> 00:01:26,340 So Bethia so here you can see the primary alert is a local success is in green color dangerous and reckless, 18 00:01:26,670 --> 00:01:31,620 and a warning is only a letter to another type of alert. 19 00:01:31,650 --> 00:01:39,690 And you can see is like a picture dismissable in nature so that you can see the alerts and the Smithsonian 20 00:01:39,690 --> 00:01:48,260 Nature have a cross button on the right hand side, which can be cleared and on the or under a refreshment 21 00:01:48,270 --> 00:01:50,310 or when I refresh this page. 22 00:01:50,680 --> 00:01:54,350 So here you can see this alert message comes, it comes up again. 23 00:01:54,690 --> 00:01:59,700 So basically you can cross the button and dismiss the message for that purpose only. 24 00:02:00,450 --> 00:02:02,060 So let's get started with this. 25 00:02:02,520 --> 00:02:04,910 So the will keep trying to keep it simple. 26 00:02:05,370 --> 00:02:17,550 So if the form is valid, title is post to subject to the subject of what I do, I create my dictionary. 27 00:02:19,710 --> 00:02:27,810 And irrespective of the result, it is going to have the form with tackle, irrespective of the result, 28 00:02:28,110 --> 00:02:29,640 I'll make condition. 29 00:02:30,200 --> 00:02:34,380 OK, then my dictionary of success 30 00:02:40,230 --> 00:02:46,530 is going to prove and same with my degree of success. 31 00:02:48,850 --> 00:02:59,640 Message is, well, the form is submitted, OK, and then what am I going to do? 32 00:02:59,650 --> 00:03:01,780 I'm going to return this page. 33 00:03:02,230 --> 00:03:08,440 So I take requests as a barometer, my phone call to the fictional context of the world worldwide cherry. 34 00:03:11,060 --> 00:03:17,960 And you can see, no, I have returned my phone, brought my home to a and contextual my dictionary, 35 00:03:18,390 --> 00:03:23,290 so basically I would move to this part where we would use this. 36 00:03:25,390 --> 00:03:28,450 And here you can see the word warning. 37 00:03:28,460 --> 00:03:32,240 So I just decided you can have it quick. 38 00:03:32,390 --> 00:03:37,430 Remember, that warning is for yellow or dangerous or red and green sort success. 39 00:03:38,050 --> 00:03:40,270 OK, what are you going to do? 40 00:03:41,290 --> 00:03:44,260 Oh, Lord, another success. 41 00:03:48,140 --> 00:03:50,110 And this Dysport. 42 00:03:52,740 --> 00:03:53,140 OK. 43 00:03:57,870 --> 00:04:07,350 And I will dispute the success message here, but only I would display the success message only on one 44 00:04:07,350 --> 00:04:16,550 condition that this person, if success is equally visible to the group, then only I will say this. 45 00:04:16,950 --> 00:04:21,800 So I would this is the end of the block and I would end conditioned person. 46 00:04:22,230 --> 00:04:26,550 And if there's a slight error here, 47 00:04:32,070 --> 00:04:32,710 I hope not. 48 00:04:33,990 --> 00:04:34,490 Right. 49 00:04:34,560 --> 00:04:41,890 So I would buy be and of OK, so I will move to my home on the request I saw. 50 00:04:42,120 --> 00:04:47,720 I get request, I render the phone and but on the post I will check the error handling. 51 00:04:48,120 --> 00:04:49,530 So what we can do that. 52 00:04:49,530 --> 00:04:51,510 I would like that. 53 00:04:54,580 --> 00:04:55,330 All right, Bill. 54 00:04:57,440 --> 00:05:00,120 Best subject. 55 00:05:01,460 --> 00:05:04,520 And here you can see it from somewhere. 56 00:05:04,820 --> 00:05:15,650 OK, so OK, there was a slight error because I missed a single acid test so it could not the background 57 00:05:15,650 --> 00:05:19,990 color, but I would refresh this process, the form resubmission. 58 00:05:20,000 --> 00:05:20,410 OK. 59 00:05:20,830 --> 00:05:22,230 OK, now it's pretty fine. 60 00:05:22,350 --> 00:05:26,330 It says so quickly so we can add a margin to this. 61 00:05:27,410 --> 00:05:33,650 So basically this would help us out the areas where the margin is equal to one. 62 00:05:40,340 --> 00:05:44,930 In order for divine, we have a modern open on the cross border, it disappeared. 63 00:05:44,960 --> 00:05:49,580 So this is pretty cool with this for the same part we can do for the area also. 64 00:05:50,090 --> 00:05:59,780 OK, but for this but what we can do, you find this condition so we will check the error. 65 00:06:00,380 --> 00:06:06,040 Well, I did this because I wanted to have a quick idea of how this works. 66 00:06:07,280 --> 00:06:11,870 OK, but if title is not OK, what we can do. 67 00:06:13,880 --> 00:06:19,800 This is our fault, OK, and we can hear. 68 00:06:24,900 --> 00:06:28,520 The next exit will take. 69 00:06:30,410 --> 00:06:30,830 No 70 00:06:36,980 --> 00:06:49,560 title should be capital, OK, so this says no title should be capital. 71 00:06:49,730 --> 00:06:53,640 OK, OK, so when we move to a fall. 72 00:06:54,130 --> 00:06:58,520 OK, no, ok, I'll say it here. 73 00:06:58,910 --> 00:07:00,320 No, no, no, no. 74 00:07:00,740 --> 00:07:03,650 This time I would make a greater percent of the full. 75 00:07:05,030 --> 00:07:05,450 Good. 76 00:07:05,480 --> 00:07:15,380 I think they're just going error, OK, OK, OK, OK, let me for the time being, if one was. 77 00:07:21,380 --> 00:07:24,030 OK, now I will go to the phone request. 78 00:07:24,500 --> 00:07:25,040 This is fine. 79 00:07:25,070 --> 00:07:27,440 OK, so there should be capital. 80 00:07:27,470 --> 00:07:40,540 OK, this was just sort of the case I'm taking a look at now if title is not illegal to title or upper. 81 00:07:41,150 --> 00:07:44,780 So this is a string class in Python which can be checked. 82 00:07:44,780 --> 00:07:53,000 If title is going to write a book, then we can what we can do, we would do the same thing. 83 00:07:53,000 --> 00:07:58,880 My dictionary of error is able to rule. 84 00:08:01,230 --> 00:08:10,590 My Dictionary of Error message is a little titled 85 00:08:13,490 --> 00:08:24,360 title should be in capital letters, OK, title should be Capital. 86 00:08:24,390 --> 00:08:25,710 OK, I hope this is fine. 87 00:08:26,790 --> 00:08:34,440 You can look up and see here that you should be in capital and then I will render the page on the same 88 00:08:34,440 --> 00:08:35,550 part of my phone. 89 00:08:36,160 --> 00:08:41,430 Well, OK, but I will only show the error only on one condition. 90 00:08:41,790 --> 00:08:55,830 That would be if errors should be true and this then I would show an error message, OK, and this should 91 00:08:55,830 --> 00:08:58,710 be my danger class. 92 00:08:59,210 --> 00:09:06,510 OK, so I hope now you have a clear idea of what's happening, so I will make that request. 93 00:09:07,920 --> 00:09:13,290 Best title, best subject. 94 00:09:15,950 --> 00:09:23,150 OK, you know, this title should be capital, OK, and if I make it OK, I'll make a test title here, 95 00:09:23,180 --> 00:09:24,080 like in capital. 96 00:09:26,400 --> 00:09:32,300 Test subject, well, we can have this in small letters issue is subject. 97 00:09:35,090 --> 00:09:41,870 A form submitted not I hope the guidance is very clear to you, so in next year we are going to work 98 00:09:41,870 --> 00:09:47,080 with the more than exception handling with the Roussey, all pages and even in the forms. 99 00:09:47,090 --> 00:09:48,350 Also the time to go. 100 00:09:48,380 --> 00:09:49,250 Thank you so much.