Example #1
0
def update_jrnl(date,mortgage_id,url_id,institution_code):
	logger = logging.getLogger('retrieve')
	logger.info('%s Updating retrieval mortgage %s', institution_code, mortgage_id)
	# insert if not there.
	if not themortgagemeter_db.is_item_there(sql_is_jrnl_there,(mortgage_id,)):
		themortgagemeter_db.run_sql(sql_insert_mortgage_jrnl,(date,mortgage_id,date,url_id))
	else:
		mortgage_jrnl_id = themortgagemeter_db.get_item_id(sql_get_jrnl_there,(mortgage_id,))
		themortgagemeter_db.run_sql(sql_update_mortgage_jrnl_retrieval,(date,url_id,mortgage_id))
Example #2
0
def update_savings_jrnl(date,savings_id,url_id,institution_code):
	logger = logging.getLogger('retrieve')
	logger.info('%s Updating retrieval savings %s', institution_code, savings_id)
	# insert if not there.
	if not themortgagemeter_db.is_item_there(sql_is_savings_jrnl_there,(savings_id,)):
		themortgagemeter_db.run_sql(sql_insert_savings_jrnl,(date,savings_id,date,url_id))
	else:
		savings_jrnl_id = themortgagemeter_db.get_item_id(sql_get_savings_jrnl_there,(savings_id,))
		themortgagemeter_db.run_sql(sql_update_savings_jrnl_retrieval,(date,url_id,savings_id))
Example #3
0
def get_mortgage_id(institution_code, mortgage_type, rate, svr, apr, ltv, initial_period, booking_fee, term, eligibility):
	return themortgagemeter_db.get_item_id(sql_get_mortgage_there,(institution_code, mortgage_type, rate, svr, apr, ltv, initial_period, booking_fee, term,  eligibility))
Example #4
0
def get_url_id_insert_if_there(url):
	if not themortgagemeter_db.is_item_there(sql_is_url_there,(url,)):
		themortgagemeter_db.run_sql(sql_insert_url,(url,))
	return themortgagemeter_db.get_item_id(sql_get_url_id,(url,))
Example #5
0
def get_url_id_insert_if_there(url):
    if not themortgagemeter_db.is_item_there(sql_is_url_there, (url, )):
        themortgagemeter_db.run_sql(sql_insert_url, (url, ))
    return themortgagemeter_db.get_item_id(sql_get_url_id, (url, ))
Example #6
0
def get_mortgage_id(institution_code, mortgage_type, rate, svr, apr, ltv,
                    initial_period, booking_fee, term, eligibility):
    return themortgagemeter_db.get_item_id(
        sql_get_mortgage_there,
        (institution_code, mortgage_type, rate, svr, apr, ltv, initial_period,
         booking_fee, term, eligibility))
Example #7
0
def get_savings_id(institution_code, isa, regular_saver, regular_saver_frequency_period, regular_saver_frequency_type, regular_saver_min_amt, regular_saver_max_amt, bonus, bonus_frequency_period, bonus_frequency_type, online, branch, variability, savings_period, min_amt, max_amt, gross_percent, aer_percent, child, interest_paid):
	return themortgagemeter_db.get_item_id(sql_get_savings_there,(institution_code, isa, regular_saver, regular_saver_frequency_period, regular_saver_frequency_type, regular_saver_min_amt, regular_saver_max_amt, bonus, bonus_frequency_period, bonus_frequency_type, online, branch, variability, savings_period, min_amt, max_amt, gross_percent, aer_percent, child, interest_paid))