20 lines
410 B
Python
20 lines
410 B
Python
# -*- 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
|