Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed A Social Network with Flask!
You have completed A Social Network with Flask!
Preview
To let users make posts, we have to have a model to store the posts in. We'll also want to add some methods to our `User` model to make fetching posts easier.
New terms
-
ForeignKeyField- A field that points to another database record.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
But then we'll set up some handy methods
on our user model to make it
0:00
easier to get messages that a given user
has posted.
0:00
'Kay.
So we need to create our post model.
0:03
This is gonna be the thing that users can
submit.
0:07
So these are like your Status Updates on
Facebook or your Tweets on Twitter.
0:11
So, let's go down here and make a new
class.
0:16
And we're gonna call this Post.
0:21
And it's going to be a model.
0:23
Now, we don't need to use the user mix in
on this because this isn't a user, so
0:27
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up