I use SQLAlchemy for Flask to create some models. The problem is that almost all of my columns require nullable=False , so I'm looking for a way to set this option by default when creating a column. Of course, I could add them manually (as a Vim exercise), but today I don't like it. For reference, here is what my setup ( models.py ) looks like:
from flask.ext.sqlalchemy import SQLAlchemy db = SQLAlchemy() class User(db.Model): id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(80), nullable=False)
and much more. Is there an easy way to do this?
Thanks in advance.
python flask-sqlalchemy sqlalchemy
John bergson
source share