1
Vote

flask-SQLAlchemy - data types are missing from completion list

description

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
db = SQLAlchemy(app)

class User(db.Model):
    id = db.Column(db.Integer, primary_key = True)
    nickname = db.Column(db.String(64), index = True, unique = True)
    email = db.Column(db.String(120), index = True, unique = True)
    role = db.Column(db.SmallInteger, default = ROLE_USER)
You'll see completions for db.Model, db.Column but you won't see db.String, db.Integer, db.SmallInteger.

Derived from tutorial at: http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-iv-database

comments