def update_statement_dao(self): if self.check_input_stock_code(): if self.ui.rdb_bs.isChecked(): result = AdminDatabase.update_db_consolidated_statement_data( self.ui.input_stock_code.text(), 'BS') self.ui.textEdit.append(result) print(result) elif self.ui.rdb_cash.isChecked(): result = AdminDatabase.update_db_consolidated_statement_data( self.ui.input_stock_code.text(), 'Cash') self.ui.textEdit.append(result) print(result) elif self.ui.rdb_pl.isChecked(): result = AdminDatabase.update_db_consolidated_statement_data( self.ui.input_stock_code.text(), 'PL') self.ui.textEdit.append(result) print(result) else: self.ui.textEdit.append("Please choose one type")
git # encoding:utf-8 # from modules import db_connector from modules.create_table import CreateTable from modules.admin_database import AdminDatabase # import sys # sys.path.append('../') # get hs300 list hs300_list_table = CreateTable.create_table_hs300_list() hs300_list_code = AdminDatabase.get_table_data(hs300_list_table.name, [hs300_list_table.c.code.name]) count = 0.0 for row in hs300_list_code[hs300_list_table.c.code.name]: AdminDatabase.update_db_k_data(row) print("update :%s OK" % row) count = count + 1 print("Percentage:%.1f%%" % (count / hs300_list_code.size * 100)) print("Completed files:%d" % count) print("Ok!")
from modules.create_table import CreateTable from modules.admin_database import AdminDatabase # get hs300 list hs300_list_table = CreateTable.create_table_hs300_list() hs300_list_code = AdminDatabase.get_table_data(hs300_list_table.name, [hs300_list_table.c.code.name]) count = 0.0 for row in hs300_list_code[hs300_list_table.c.code.name]: AdminDatabase.update_db_consolidated_statement_data(row, 'BS') AdminDatabase.update_db_consolidated_statement_data(row, 'PL') AdminDatabase.update_db_consolidated_statement_data(row, 'Cash') count = count + 1 print("Percentage:%.1f%%" % (count / hs300_list_code.size * 100)) print("Completed files:%d" % count) print("Ok!")
from modules.admin_database import AdminDatabase AdminDatabase.update_db_dividend_data()
def update_sz50_dao(self): result = AdminDatabase.update_data_sz50() self.ui.textEdit.append(str(result)) print(result)
def update_k_data_dao(self): if self.check_input_stock_code(): result = AdminDatabase.update_db_k_data( self.ui.input_stock_code.text()) self.ui.textEdit.append(str(result)) print(result)
def update_dividend_data_dao(self): result = AdminDatabase.update_db_dividend_data() self.ui.textEdit.append(str(result)) print(result)