devicehub-django/user/management/commands/add_institution.py
2024-09-17 17:28:14 +02:00

13 lines
356 B
Python

from django.core.management.base import BaseCommand
from user.models import Institution
class Command(BaseCommand):
help = "Create a new Institution"
def add_arguments(self, parser):
parser.add_argument('name', type=str, help='institution')
def handle(self, *args, **kwargs):
Institution.objects.create(name=kwargs['name'])