changed import

master
Alex 7 years ago
parent e6bc9a7ff9
commit ef76a5c4ba

@ -10,10 +10,16 @@ ap.add_argument("csv", help = "csv file to import")
ap.add_argument("--limit", type=int, default = None, help = "limit to x number of x") ap.add_argument("--limit", type=int, default = None, help = "limit to x number of x")
args = ap.parse_args() args = ap.parse_args()
print(args) with open(args.csv) as f:
for row in DictReader(f):
#print(row['Title'])
book = Book (row['Title'], "", "", row['Format'], row['Shelf'])
db.session.add(book)
db.session.commit()
#app = Flask(__name__) #app = Flask(__name__)
books = db.session.query(Book).all() #books = db.session.query(Book).all()
#print(books) #print(books)
# @app.cli.command() # @app.cli.command()

Loading…
Cancel
Save