def copy_teams_from_season_aux(season, teams): position = 1 for t in teams: ti = TeamInstance() ti.copy_from_team_instance(t, position) ti.save() season.teams.add(ti) position += 1
def copy_teams_from_base(season): for t in Team.objects.all(): ti = TeamInstance() ti.copy_from_team(t) ti.save() season.teams.add(ti)