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

12 lines
365 B
Python
Raw Permalink Normal View History

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()