right-tree/backend/right_tree/api/management/commands/resetplants.py

11 lines
365 B
Python

from django.core.management.base import BaseCommand
from right_tree.api.models import Plant
class Command(BaseCommand):
help = 'Removes all plant objects from the database'
def handle(self, *args, **options):
self.stdout.write(self.style.WARNING(
'Removing all plant objects from the database.'))
Plant.objects.all().delete()