From 6e6c49f3ccf638c88d50391a9d48128fce346ac6 Mon Sep 17 00:00:00 2001 From: fsoest Date: Sat, 11 Jan 2025 11:00:35 +0100 Subject: [PATCH] Create setup script to create modules --- S1/initial_setup.sh | 3 ++- S1/waitinglists/management/commands/make_modules.py | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 S1/waitinglists/management/commands/make_modules.py diff --git a/S1/initial_setup.sh b/S1/initial_setup.sh index d7807ab..51ac6e4 100644 --- a/S1/initial_setup.sh +++ b/S1/initial_setup.sh @@ -1,4 +1,5 @@ python manage.py makemigrations python manage.py migrate python manage.py create_mentor_group -python manage.py collectstatic \ No newline at end of file +python manage.py collectstatic +python manage.py make_modules \ No newline at end of file diff --git a/S1/waitinglists/management/commands/make_modules.py b/S1/waitinglists/management/commands/make_modules.py new file mode 100644 index 0000000..d7d7ebf --- /dev/null +++ b/S1/waitinglists/management/commands/make_modules.py @@ -0,0 +1,12 @@ +from django.core.management.base import BaseCommand + +from waitinglists.models import Module + + +class Command(BaseCommand): + help = "Initial setup to create modules" + + def handle(self, *args, **kwargs): + Module.objects.create(name="Module 1") + Module.objects.create(name="Module 3") + Module.objects.create(name="Module 4")