def upload_df(self, df: pd.DataFrame) -> None:
        if Court.objects.exists():
            print('Courts data already uploaded')
            return
        print('Uploading courts...')

        with transaction.atomic():
            courts_count = load_courts(df)

        print('Detected %d courts' % courts_count)
        print('Caching courts config for Locate tasks...')

        dict_data_cache.cache_court_config()
def courts_loader(zip_file: ZipFile, files: list) -> None:
    if Court.objects.exists():
        print('Courts data already uploaded')
        return
    print('Uploading courts...')

    df = load_csv_files(zip_file, files)
    with transaction.atomic():
        courts_count = load_courts(df)

    print('Detected %d courts' % courts_count)
    print('Caching courts config for Locate tasks...')

    dict_data_cache.cache_court_config()