added delete player data in db only script

This commit is contained in:
nprasad2077 committed 2023-04-20 16:42:13 -05:00
1 parent ffb8fb0f80
commit 857faf17d4
2 files changed
+14 -1

No files matched your search

@@ -0,0 +1,12 @@
from django.core.management.base import BaseCommand
from nba_data.models import PlayerData
class Command(BaseCommand):
# Provides a description for use with the custom django management command (python manage.py help).
help = 'Delete all player data'
def handle(self, *args, **options):
# Delete all player data
PlayerData.objects.all().delete()
self.stdout.write(self.style.SUCCESS('Successfully deleted all players in DB'))