Skip to content

Instantly share code, notes, and snippets.

@Kotauror
Created October 29, 2018 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Kotauror/294fbf96f201ad95a8a2dff23c9922ea to your computer and use it in GitHub Desktop.
Save Kotauror/294fbf96f201ad95a8a2dff23c9922ea to your computer and use it in GitHub Desktop.
models.py
from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
class Contact(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(80), unique=True)
def __init__(self, name):
self.name = name
def __repr__(self):
return '<Contact %r>' % self.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment