1
00:00:05,300 --> 00:00:06,640
Welcome back everyone.

2
00:00:06,650 --> 00:00:11,750
We've already seen how to run our site and test the capabilities of registering logging in and logging

3
00:00:11,750 --> 00:00:15,290
out as users as well as updating a user account.

4
00:00:15,290 --> 00:00:20,480
Now it's time to move off to the second main component which is the blog post component so we'll start

5
00:00:20,480 --> 00:00:25,070
off by setting up the forms for creating a new blog post and then we'll move on to connecting the views

6
00:00:25,070 --> 00:00:26,960
to the blog post templates.

7
00:00:26,960 --> 00:00:28,140
Let's get started.

8
00:00:28,190 --> 00:00:32,150
So we're going to do this lecture is just set up our forms for our blog posts.

9
00:00:32,150 --> 00:00:37,190
So underneath the blog posts directory I have this forms up high file.

10
00:00:37,220 --> 00:00:42,830
So underneath blog posts right now we're in forums stop PI and this will actually be a pretty simple

11
00:00:42,830 --> 00:00:43,870
form to set up.

12
00:00:43,970 --> 00:00:53,530
We're just going to say from flask WCF import flask form then we'll save from the beauty forms import

13
00:00:54,100 --> 00:01:01,120
and we'll say String Field submit field and then text area field Ritchies in text area because that's

14
00:01:01,120 --> 00:01:03,760
going to be the larger text portion of a blog post.

15
00:01:04,670 --> 00:01:09,650
And then finally you will added some validators so we don't just have empty blog posts will say from

16
00:01:09,710 --> 00:01:17,150
W.T. forums that validators import data required then we'll just set up a simple class here.

17
00:01:17,610 --> 00:01:26,600
Call it blog post form will inherit from flask form and we really just have two things we need to check.

18
00:01:26,600 --> 00:01:28,760
One is that the tiles been provided.

19
00:01:28,820 --> 00:01:33,750
So say the string field title and then the validators.

20
00:01:33,800 --> 00:01:39,820
We're actually going to require a title in order to display correctly and then the text of the actual

21
00:01:39,820 --> 00:01:40,540
blog post.

22
00:01:40,570 --> 00:01:47,790
So that's going to be a text field to give the user more room than will say text and then the validator.

23
00:01:47,790 --> 00:01:54,100
Here again is just going to be data required then to have a submit button to submit their form.

24
00:01:54,190 --> 00:02:01,030
Remember by default we actually have the date of the blog post automatically set to when they hit this

25
00:02:01,030 --> 00:02:01,750
button.

26
00:02:01,930 --> 00:02:04,900
So the Submit field will go ahead and just saying like post.

27
00:02:04,900 --> 00:02:10,090
You can also say blog post whatever you want that button to say so save that and we successfully set

28
00:02:10,090 --> 00:02:12,830
up our forms for our blog posts.

29
00:02:12,830 --> 00:02:17,710
So pretty short lecture because coming up next we're going to the harder part which is actually setting

30
00:02:17,710 --> 00:02:22,280
up the views we'll see at the next lecture where we set up the views for the blog posts.
