Add umpire data export functionality

The commit adds a new endpoint and functionality to gather tournament
and umpire contact information from the French Tennis Federation (FFT)
API, and export it as a CSV file. The changes include:

- Add route for monthly tournament/umpire data export - Add view to
fetch tournaments and umpire data in batches - Add CSV export of umpire
contact details - Clean up tournament model fields
main
Razmig Sarkissian 1 month ago
parent 35884b728f
commit 5c36eb8781
  1. 7
      padelclub_backend/urls.py
  2. 1238
      tournaments/admin_utils.py
  3. 4
      tournaments/models/tournament.py

@ -18,7 +18,7 @@ from django.urls import include, path
from django.conf import settings from django.conf import settings
from django.conf.urls.static import static from django.conf.urls.static import static
from tournaments.admin_utils import download_french_padel_rankings, debug_tools_page, test_player_details_apis, explore_fft_api_endpoints, get_player_license_info, bulk_license_lookup, search_player_by_name, enrich_rankings_with_licenses from tournaments.admin_utils import download_french_padel_rankings, debug_tools_page, test_player_details_apis, explore_fft_api_endpoints, get_player_license_info, bulk_license_lookup, search_player_by_name, enrich_rankings_with_licenses, gather_monthly_tournaments_and_umpires
urlpatterns = [ urlpatterns = [
@ -38,6 +38,11 @@ urlpatterns = [
path('kingdom/', admin.site.urls), path('kingdom/', admin.site.urls),
path('api-auth/', include('rest_framework.urls')), path('api-auth/', include('rest_framework.urls')),
path('dj-auth/', include('django.contrib.auth.urls')), path('dj-auth/', include('django.contrib.auth.urls')),
path(
"kingdom/debug/gather-monthly-umpires/",
gather_monthly_tournaments_and_umpires,
name="gather_monthly_umpires",
),
] ]

File diff suppressed because it is too large Load Diff

@ -96,8 +96,8 @@ class Tournament(BaseModel):
club_member_fee_deduction = models.FloatField(null=True, blank=True) club_member_fee_deduction = models.FloatField(null=True, blank=True)
unregister_delta_in_hours = models.IntegerField(default=24) unregister_delta_in_hours = models.IntegerField(default=24)
currency_code = models.CharField(null=True, blank=True, max_length=3, default='EUR') currency_code = models.CharField(null=True, blank=True, max_length=3, default='EUR')
parent = models.ForeignKey('self', blank=True, null=True, on_delete=models.SET_NULL, related_name='children') # parent = models.ForeignKey('self', blank=True, null=True, on_delete=models.SET_NULL, related_name='children')
loser_index = models.IntegerField(default=0) # loser_index = models.IntegerField(default=0)
def delete_dependencies(self): def delete_dependencies(self):
for team_registration in self.team_registrations.all(): for team_registration in self.team_registrations.all():

Loading…
Cancel
Save