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

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))
writingfield = db.Column(db.String(10000))
category = db.Column(db.String(100))
def __init__(self, title, writingfield, category):
self.title = title
self.writingfield = writingfield
self.category = category
db.create_all()