blabla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

30 lines
707 B

"""from newxtloud get a list of titles to populate DB"""
from requests import session
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from config import CONFIG
from create_db import Base, Card
from get_files import get_file_list
engine = create_engine(CONFIG['DB_CONNECTION'])
Base.metadata.bind = engine
DBSsession = sessionmaker(bind=engine)
session = DBSsession()
l = get_file_list()
id = 0 #TODO
for title in l:
if title[-4:] == ".pdf":
card = Card(
id=id,
title=title[:-4],
interest_rate=-1,
owner_id = 1
)
session.add(card)
session.commit()
session.close()
id = id+1