diff --git a/data_migration/data_dump.py b/data_migration/data_dump.py index 8de90d1..1039e94 100644 --- a/data_migration/data_dump.py +++ b/data_migration/data_dump.py @@ -105,14 +105,18 @@ 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 + } @@ -120,8 +124,11 @@ def transform_problem(problem): return { 'id': problem['id'], 'text': re.sub(r'\s+
  • ', '
  • ', problem['text']), + 'order': problem['position']+1, + 'image': None, + 'solution_pdf': None, 'series_id': problem['series_id'], - 'order': problem['position']+1 + } @@ -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'] } diff --git a/data_migration/semester_imported.csv b/data_migration/semester_imported.csv deleted file mode 100644 index 23b5d26..0000000 --- a/data_migration/semester_imported.csv +++ /dev/null @@ -1,71 +0,0 @@ -id,year,school_year,season_code,start,end,location,additional_name,competition_id,registration_link_id -3,39,2015/2016,0,2014-08-31 22:00:00+02,2014-12-30 23:00:00+01,,,0, -4,32,2008/2009,0,2007-08-31 22:00:00+02,2007-11-30 23:00:00+01,,,0, -5,32,2008/2009,1,2008-02-29 23:00:00+01,2008-06-30 22:00:00+02,,,0, -6,33,2009/2010,0,2008-08-31 22:00:00+02,2008-11-30 23:00:00+01,,,0, -7,33,2009/2010,1,2009-02-28 23:00:00+01,2009-06-30 22:00:00+02,,,0, -8,34,2010/2011,0,2009-08-31 22:00:00+02,2009-11-30 23:00:00+01,,,0, -9,34,2010/2011,1,2010-02-28 23:00:00+01,2010-06-30 22:00:00+02,,,0, -10,35,2011/2012,0,2010-08-31 22:00:00+02,2010-11-30 23:00:00+01,,,0, -11,35,2011/2012,1,2011-02-28 23:00:00+01,2011-06-30 22:00:00+02,,,0, -12,36,2012/2013,0,2011-08-31 22:00:00+02,2011-11-30 23:00:00+01,,,0, -13,36,2012/2013,1,2012-02-29 23:00:00+01,2012-06-30 22:00:00+02,,,0, -14,37,2013/2014,0,2012-08-31 22:00:00+02,2012-11-30 23:00:00+01,,,0, -15,37,2013/2014,1,2013-02-28 23:00:00+01,2013-06-30 22:00:00+02,,,0, -16,38,2014/2015,0,2013-08-31 22:00:00+02,2013-11-30 23:00:00+01,,,0, -17,38,2014/2015,1,2014-02-28 23:00:00+01,2014-06-30 22:00:00+02,,,0, -18,39,2015/2016,1,2015-02-28 23:00:00+01,2015-06-30 22:00:00+02,,,0, -19,25,2016/2017,0,2015-08-31 22:00:00+02,2015-12-31 23:00:00+01,,,2, -20,40,2016/2017,0,2015-08-31 22:00:00+02,2015-12-31 22:59:00+01,,,0, -21,29,2016/2017,0,2015-08-31 22:00:00+02,2015-12-30 23:00:00+01,,,1, -22,29,2016/2017,1,2016-01-31 23:00:00+01,2016-06-29 22:00:00+02,,,1, -23,25,2016/2017,1,2016-01-31 23:00:00+01,2016-06-29 22:00:00+02,,,2, -24,40,2016/2017,1,2016-01-31 23:00:00+01,2016-06-29 22:00:00+02,,,0, -25,41,2017/2018,0,2016-08-31 22:00:00+02,2017-01-31 22:59:00+01,,,0, -26,30,2017/2018,0,2016-08-31 22:00:00+02,2016-12-30 23:00:00+01,,,1, -27,26,2017/2018,0,2016-08-31 22:00:00+02,2016-12-30 23:00:00+01,,,2, -28,26,2017/2018,1,2017-01-31 23:00:00+01,2017-06-29 22:00:00+02,,,2, -29,30,2017/2018,1,2017-01-31 23:00:00+01,2017-06-29 22:00:00+02,,,1, -30,41,2017/2018,1,2017-01-31 23:00:00+01,2017-06-30 21:59:00+02,,,0, -31,31,2018/2019,0,2017-09-17 22:00:00+02,2017-12-30 23:00:00+01,,,1, -32,27,2018/2019,0,2017-09-17 22:00:00+02,2017-12-30 23:00:00+01,,,2, -33,42,2018/2019,0,2017-09-17 22:00:00+02,2018-01-31 22:59:00+01,,,0, -34,42,2018/2019,1,2018-02-17 23:00:00+01,2018-06-30 21:59:00+02,,,0, -35,31,2018/2019,1,2018-02-21 23:00:00+01,2018-06-29 22:00:00+02,,,1, -36,27,2018/2019,1,2018-02-22 23:00:00+01,2018-06-29 22:00:00+02,,,2, -37,32,2019/2020,0,2018-08-31 22:00:00+02,2018-12-31 22:59:00+01,,,1, -38,28,2019/2020,0,2018-08-31 22:00:00+02,2018-12-31 22:59:00+01,,,2, -39,43,2019/2020,0,2018-09-12 22:00:00+02,2019-01-31 22:59:00+01,,,0, -40,32,2019/2020,1,2019-02-25 23:00:00+01,2019-06-29 22:00:00+02,,,1, -41,28,2019/2020,1,2019-02-27 23:00:00+01,2019-06-30 21:59:00+02,,,2, -42,43,2019/2020,1,2019-01-31 23:00:00+01,2019-06-30 21:59:00+02,,,0, -43,29,2020/2021,0,2019-09-01 10:00:00+02,2020-01-31 11:00:00+01,,,2, -44,33,2020/2021,0,2019-08-31 22:00:00+02,2019-12-30 23:00:00+01,,,1, -45,44,2020/2021,0,2019-08-31 22:00:00+02,2020-01-31 22:59:00+01,,,0, -46,33,2020/2021,1,2020-02-23 08:00:00+01,2020-06-29 22:00:00+02,,,1, -47,44,2020/2021,1,2020-01-31 23:00:00+01,2020-06-29 22:00:00+02,,,0, -48,29,2020/2021,1,2020-02-25 08:00:00+01,2020-06-29 22:00:00+02,,,2, -49,34,2021/2022,0,2020-08-31 22:00:00+02,2020-12-30 23:00:00+01,,,1, -50,30,2021/2022,0,2020-08-31 22:00:00+02,2020-12-30 23:00:00+01,,,2, -51,45,2021/2022,0,2020-08-31 22:00:00+02,2021-01-31 22:59:00+01,,,0, -52,30,2021/2022,1,2021-01-24 23:00:00+01,2021-06-29 22:00:00+02,,,2, -54,34,2021/2022,1,2021-01-24 23:00:00+01,2021-06-29 22:00:00+02,,,1, -55,45,2021/2022,1,2021-01-31 23:00:00+01,2021-06-30 21:59:59+02,,,0, -56,46,2022/2023,0,2021-08-31 22:00:00+02,2022-01-31 22:59:00+01,,,0, -57,31,2022/2023,0,2021-08-31 22:00:00+02,2021-12-30 23:00:00+01,,,2, -58,35,2022/2023,0,2021-08-31 22:00:00+02,2021-12-30 23:00:00+01,,,1, -59,46,2022/2023,1,2022-01-21 23:00:00+01,2022-06-30 21:59:59+02,,,0, -60,31,2022/2023,1,2022-01-31 23:00:00+01,2022-06-10 22:00:00+02,,,2, -61,35,2022/2023,1,2022-01-31 23:00:00+01,2022-06-29 22:00:00+02,,,1, -62,47,2023/2024,0,2022-08-31 22:00:00+02,2023-01-31 22:59:00+01,,,0, -63,36,2023/2024,0,2022-08-31 22:00:00+02,2022-12-30 23:00:00+01,,,1, -64,32,2023/2024,0,2022-08-31 22:00:00+02,2022-12-30 23:00:00+01,,,2, -65,32,2023/2024,1,2023-01-22 23:00:00+01,2023-07-30 22:00:00+02,,,2, -66,36,2023/2024,1,2023-01-31 23:00:00+01,2023-07-30 22:00:00+02,,,1, -67,47,2023/2024,1,2023-02-08 23:00:00+01,2023-07-08 21:59:59+02,,,0, -68,33,2024/2025,0,2023-08-31 22:00:00+02,2023-12-30 23:00:00+01,,,2, -69,37,2024/2025,0,2023-08-31 22:00:00+02,2023-12-30 23:00:00+01,,,1, -70,48,2024/2025,0,2023-08-31 22:00:00+02,2024-01-31 22:59:00+01,,,0, -71,33,2024/2025,1,2023-12-31 23:00:00+01,2024-06-29 22:00:00+02,,,2, -72,37,2024/2025,1,2023-12-31 23:00:00+01,2024-06-29 22:00:00+02,,,1, -73,48,2024/2025,1,2024-02-11 23:00:00+01,2024-06-29 22:00:00+02,,,0,