MCPcopy Index your code
hub / github.com/realpython/discover-flask / BlogPost

Class BlogPost

project/models.py:8–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7
8class BlogPost(db.Model):
9
10 __tablename__ = "posts"
11
12 id = db.Column(db.Integer, primary_key=True)
13 title = db.Column(db.String, nullable=False)
14 description = db.Column(db.String, nullable=False)
15 author_id = db.Column(db.Integer, ForeignKey('users.id'))
16
17 def __init__(self, title, description, author_id):
18 self.title = title
19 self.description = description
20 self.author_id = author_id
21
22 def __repr__(self):
23 return '<title {}'.format(self.title)
24
25
26class User(db.Model):

Callers 2

homeFunction · 0.90
setUpMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected