Browse Source

implement init_default_data command

blezz-tech 1 month ago
parent
commit
775d51b9b6
1 changed files with 9 additions and 5 deletions
  1. 9 5
      management/commands/init_default_data.py

+ 9 - 5
management/commands/init_default_data.py

@@ -1,11 +1,15 @@
 from django.core.management.base import BaseCommand
 
+from dbsynce.lib.seed import *
 
 class Command(BaseCommand):
-    help = "My shiny new management command."
-
-    def add_arguments(self, parser):
-        parser.add_argument('sample', nargs='+')
+    help = "Create initial data."
 
     def handle(self, *args, **options):
-        raise NotImplementedError()
+        self.stdout.write(self.style.SUCCESS('Start seeding'))
+
+        create_initial_groups()
+        create_initial_ticket_lists()
+
+        self.stdout.write(self.style.SUCCESS('Successful seeding'))
+        # raise NotImplementedError()