addded example models
This commit is contained in:
19
models/post_model.py
Normal file
19
models/post_model.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
Example post model and related models
|
||||
"""
|
||||
|
||||
from backend import db
|
||||
|
||||
|
||||
class Post(db.Model):
|
||||
"""
|
||||
A post example class
|
||||
"""
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
body = db.Column(db.String(140))
|
||||
timestamp = db.Column(db.DateTime)
|
||||
user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
|
||||
|
||||
def __repr__(self):
|
||||
return '<Post %r>' % self.body
|
||||
Reference in New Issue
Block a user