You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
493 B
Python

5 years ago
from flask_sqlalchemy import SQLAlchemy
import datetime
from app import app
db = SQLAlchemy(app)
class Posts(db.Model):
pid = db.Column(db.Integer, primary_key=True, autoincrement=True)
title = db.Column(db.String(100))
5 years ago
writingfield = db.Column(db.String(10000))
category = db.Column(db.String(100))
5 years ago
5 years ago
def __init__(self, title, writingfield, category):
5 years ago
self.title = title
self.writingfield = writingfield
5 years ago
self.category = category
5 years ago
db.create_all()