Merge pull request 'fix: replace row-by-row DELETE with bulk DELETE in career recalculation (#77)' (#92) from issue/77-replace-row-by-row-delete-with-bulk-delete-in-care into main
This commit is contained in:
commit
ca15dfe380
@ -1594,9 +1594,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(
|
||||
@ -1659,9 +1657,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(
|
||||
@ -1713,9 +1709,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(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user