Last active
August 30, 2016 20:59
-
-
Save singingwolfboy/73b15d864ad251fe71a374bd9f02ddbe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from flask_sqlalchemy import SQLAlchemy | |
app = Flask(__name__) | |
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///" | |
db1 = SQLAlchemy() | |
db2 = SQLAlchemy() | |
class Model1(db1.Model): | |
id = db.Column(db.Integer, primary_key=True) | |
name = db.Column(db.String(256)) | |
# db1.init_app(app) | |
db2.init_app(app) | |
app.route("/") | |
def index(): | |
models = Model1.query.all() | |
return ", ".join(m.name for m in models) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment