I have an existing sqlite db file imported from csv. I tried to use sqlalchemy to automap the db file. But it always gives me...
Traceback (most recent call last): File "", line 1, in File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\lib\site-packages\sqlalchemy\util_colle ctions.py", line 212, in getattr raise AttributeError(key) AttributeError: destinationservices
Any help is appreciated.
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine
Base = automap_base()
# engine, suppose it has two tables 'user' and 'address' set up
engine = create_engine("sqlite:///destServ.db")
# reflect the tables
Base.prepare(engine, reflect=True)
# mapped classes are now created with names by default
# matching that of the table name.
Service = Base.classes.destinationServices