Esempio n. 1
0
def populate_tagsDescribeJobs_data():
    drop_table()
    create_table()
    table_name = 'tagsDescribeJobs'
    data_src = get_data_src(table_name)
    assign_tags(get_data_src('jobs'), get_data_src('jobTags'), data_src)
    populate_table(table_name, data_src)
Esempio n. 2
0
def populate_jobs_data():
    drop_table()
    create_table()

    companies_count = get_companies_count()

    # massaging job data before saving into DB
    def transform_job(job):
        # Convert date to MYSQL date format. NULL if no date.
        job[2] = None if job[2] == '' else dt.datetime.strptime(
            job[2], '%m/%d/%Y').strftime('%Y-%m-%d')
        # Convert has_expired to boolean
        job[3] = True if job[3] == 'Yes' else False
        # Randomly assign job to a company that exists in the DB
        job[-1] = random.randint(1,
                                 companies_count) if companies_count > 0 else 0

    table_name = 'jobs'
    data_src = get_data_src(table_name)
    populate_table(table_name, data_src, transform_job)
Esempio n. 3
0
def populate_matches_data():
    drop_table()
    create_table()
    table_name = 'matches'
    data_src = get_data_src(table_name)
    populate_table(table_name, data_src)
Esempio n. 4
0
def populate_candidates_data():
    drop_table()
    create_table()
    table_name = 'candidates'
    data_src = get_data_src(table_name)
    populate_table(table_name, data_src)
Esempio n. 5
0
def populate_accounts_data():
    drop_account_and_children()
    create_table()
    table_name = 'accounts'
    data_src = get_data_src(table_name)
    populate_table(table_name, data_src)
Esempio n. 6
0
def populate_employers_data():
    drop_table()
    create_table()
    table_name = 'employers'
    data_src = get_data_src(table_name)
    populate_table(table_name, data_src)
Esempio n. 7
0
def populate_jobSeenCandidate_data():
    drop_table()
    create_table()
    table_name = 'jobSeenCandidate'
    data_src = get_data_src(table_name)
    populate_table(table_name, data_src)
Esempio n. 8
0
def populate_jobTags_data():
    drop_table()
    create_table()
    table_name = 'jobTags'
    data_src = get_data_src(table_name)
    populate_table(table_name, data_src)