Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from app import app, db # DB is your Flask-SQLAlchemy object
- # By default this will correspond to a table named "ticket" in your db
- # You can override this, of course (see the docs) to point to any tablename
- class Ticket(db.Model):
- id = db.Column(db.Integer, primary_key=True)
- date = db.Column(db.DateTime, nullable=False)
- severity = db.Column(db.Integer, nullable=False, default=0)
- message = db.Column(db.String)
- # No constructor needed, generally, unless you're doing something extra!
- # SQLAlchemy handles all that stuff for you
Add Comment
Please, Sign In to add comment