Skip to content

Commit

Permalink
Pridane semestrove data
Browse files Browse the repository at this point in the history
  • Loading branch information
kovacspe committed Nov 21, 2024
1 parent b979afb commit 770cbb1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 77 deletions.
19 changes: 13 additions & 6 deletions data_migration/data_dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,23 +105,30 @@ def to_school_year(year, competition):
def transform_semester(semester):
return {
'id': semester['id'],
'season_code': semester['number']-1,
'competition': COMPETITION_ID_MAPPING[semester['competition_id']],
'year': semester['year'],
'school_year': to_school_year(
semester['year'],
COMPETITION_ID_MAPPING[semester['competition_id']]),
'season_code': semester['number']-1,
'start': localize(semester['start']),
'end': localize(semester['end'])
'end': localize(semester['end']),
'location': None,
'additional_name': None,
'competition_id': COMPETITION_ID_MAPPING[semester['competition_id']],
'registration_link_id': None

}


def transform_problem(problem):
return {
'id': problem['id'],
'text': re.sub(r'\s+<li>', '<li>', problem['text']),
'order': problem['position']+1,
'image': None,
'solution_pdf': None,
'series_id': problem['series_id'],
'order': problem['position']+1

}


Expand All @@ -136,11 +143,11 @@ def transform_series(series, results):

return {
'id': series['id'],
'semester_id': series['season_id'],
'order': series['number'],
'deadline': localize(series['submission_deadline']),
'sum_method': SUM_METHOD_DICT[series['sum_method']],
'frozen_results': get_relevant_series_results(results, series['season_id'], series['number'])
'frozen_results': get_relevant_series_results(results, series['season_id'], series['number']),
'semester_id': series['season_id']
}


Expand Down
71 changes: 0 additions & 71 deletions data_migration/semester_imported.csv

This file was deleted.

0 comments on commit 770cbb1

Please sign in to comment.