fix: replace row-by-row DELETE with bulk DELETE in career recalculation (#77) #92
@ -1372,9 +1372,7 @@ class BattingCareer(BaseModel):
|
||||
@staticmethod
|
||||
def recalculate():
|
||||
# Wipe existing data
|
||||
delete_lines = BattingCareer.select()
|
||||
for line in delete_lines:
|
||||
line.delete_instance()
|
||||
BattingCareer.delete().execute()
|
||||
|
||||
# For each seasonstat, find career or create new and increment
|
||||
for this_season in BattingSeason.select().where(BattingSeason.season_type == 'Regular'):
|
||||
@ -1433,9 +1431,7 @@ class PitchingCareer(BaseModel):
|
||||
@staticmethod
|
||||
def recalculate():
|
||||
# Wipe existing data
|
||||
delete_lines = PitchingCareer.select()
|
||||
for line in delete_lines:
|
||||
line.delete_instance()
|
||||
PitchingCareer.delete().execute()
|
||||
|
||||
# For each seasonstat, find career or create new and increment
|
||||
for this_season in PitchingSeason.select().where(PitchingSeason.season_type == 'Regular'):
|
||||
@ -1483,9 +1479,7 @@ class FieldingCareer(BaseModel):
|
||||
@staticmethod
|
||||
def recalculate():
|
||||
# Wipe existing data
|
||||
delete_lines = FieldingCareer.select()
|
||||
for line in delete_lines:
|
||||
line.delete_instance()
|
||||
FieldingCareer.delete().execute()
|
||||
|
||||
# For each seasonstat, find career or create new and increment
|
||||
for this_season in FieldingSeason.select().where(FieldingSeason.season_type == 'Regular'):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user