addded example models

This commit is contained in:
2019-03-12 09:17:55 +01:00
parent 38ab1578b0
commit 3c4e3719d7
6 changed files with 377 additions and 6 deletions

19
models/post_model.py Normal file
View 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