From bbfbd4691f8c2445fb3e6cd6f8bbe9e8030e7ec0 Mon Sep 17 00:00:00 2001 From: Joshua Hairston Date: Thu, 26 Sep 2024 12:00:20 -0400 Subject: [PATCH 01/13] added functionally for auto formatter with git actions --- .github/workflows/blackformatter.yml | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/blackformatter.yml diff --git a/.github/workflows/blackformatter.yml b/.github/workflows/blackformatter.yml new file mode 100644 index 0000000..1bed9bd --- /dev/null +++ b/.github/workflows/blackformatter.yml @@ -0,0 +1,39 @@ +name: Check Python Code Formatting + +on: + pull_request: + branches: + - main + +jobs: + format-check: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12.x" + + - name: Install Black + run: pip install black + + - name: Run Black + run: black . + + - name: Commit changes if formatting is needed + run: | + git config --local user.name "github-actions[bot]" + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git add . + git diff --cached --exit-code || git commit -m "Auto-format code with Black" + + - name: Push changes back to the pull request branch + uses: gr2m/create-or-update-pull-request-action@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 6623e001f08e92d6f3ed6f6b4c1fe178395512a9 Mon Sep 17 00:00:00 2001 From: "Michael C. Stewart" Date: Thu, 26 Sep 2024 12:05:11 -0400 Subject: [PATCH 02/13] Update README.md corrected project title --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 271327f..c62812e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# TeleBand +# MusicCPR The music education learning management system From 08cb0b1be34b66e67d304e9fac555e0bc6bf78db Mon Sep 17 00:00:00 2001 From: "Michael C. Stewart" Date: Thu, 26 Sep 2024 12:17:21 -0400 Subject: [PATCH 03/13] Update blackformatter.yml seems like the create-or-update pr action doesn't actually handle local commits? --- .github/workflows/blackformatter.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/blackformatter.yml b/.github/workflows/blackformatter.yml index 1bed9bd..b918e2d 100644 --- a/.github/workflows/blackformatter.yml +++ b/.github/workflows/blackformatter.yml @@ -25,15 +25,10 @@ jobs: - name: Run Black run: black . - - - name: Commit changes if formatting is needed - run: | - git config --local user.name "github-actions[bot]" - git config --local user.email "github-actions[bot]@users.noreply.github.com" - git add . - git diff --cached --exit-code || git commit -m "Auto-format code with Black" - + - name: Push changes back to the pull request branch uses: gr2m/create-or-update-pull-request-action@v1 + with: + author: "github-actions[bot] " env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 8a139090e47222532f47dec872d2eb2062086d1e Mon Sep 17 00:00:00 2001 From: "Michael C. Stewart" Date: Thu, 26 Sep 2024 12:21:04 -0400 Subject: [PATCH 04/13] Update blackformatter.yml --- .github/workflows/blackformatter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/blackformatter.yml b/.github/workflows/blackformatter.yml index b918e2d..c4d91e7 100644 --- a/.github/workflows/blackformatter.yml +++ b/.github/workflows/blackformatter.yml @@ -30,5 +30,6 @@ jobs: uses: gr2m/create-or-update-pull-request-action@v1 with: author: "github-actions[bot] " + commit-message: "Formatted with Black per repo requirements" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 7bd33b6c7f9ed77690dc188d06c16086359377a8 Mon Sep 17 00:00:00 2001 From: Joshua Hairston Date: Thu, 10 Oct 2024 12:31:14 -0400 Subject: [PATCH 05/13] black formatter check --- .github/workflows/blackformatter.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/blackformatter.yml b/.github/workflows/blackformatter.yml index 1bed9bd..52411d5 100644 --- a/.github/workflows/blackformatter.yml +++ b/.github/workflows/blackformatter.yml @@ -25,15 +25,3 @@ jobs: - name: Run Black run: black . - - - name: Commit changes if formatting is needed - run: | - git config --local user.name "github-actions[bot]" - git config --local user.email "github-actions[bot]@users.noreply.github.com" - git add . - git diff --cached --exit-code || git commit -m "Auto-format code with Black" - - - name: Push changes back to the pull request branch - uses: gr2m/create-or-update-pull-request-action@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 940996315f5fd3ee5e806733ac05dc57280f224e Mon Sep 17 00:00:00 2001 From: Joshua Hairston Date: Thu, 10 Oct 2024 12:57:55 -0400 Subject: [PATCH 06/13] added git diff for error code --- .github/workflows/blackformatter.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/blackformatter.yml b/.github/workflows/blackformatter.yml index 52411d5..d347240 100644 --- a/.github/workflows/blackformatter.yml +++ b/.github/workflows/blackformatter.yml @@ -25,3 +25,6 @@ jobs: - name: Run Black run: black . + + - name: Check for changes after formatting + run: git diff --exit-code From 522116e2e109f341a88b56ddc7ce260d95339b1d Mon Sep 17 00:00:00 2001 From: "Michael C. Stewart" Date: Fri, 18 Oct 2024 17:11:20 -0400 Subject: [PATCH 07/13] Update blackformatter.yml remove extraneous step https://lab-lab-lab.slack.com/archives/D075ZRTDMML/p1728581527850209 --- .github/workflows/blackformatter.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/blackformatter.yml b/.github/workflows/blackformatter.yml index d347240..05bd5f0 100644 --- a/.github/workflows/blackformatter.yml +++ b/.github/workflows/blackformatter.yml @@ -24,7 +24,4 @@ jobs: run: pip install black - name: Run Black - run: black . - - - name: Check for changes after formatting - run: git diff --exit-code + run: black . --check From 8a8412f31778caa00a9afe1d6f75657addc50ed3 Mon Sep 17 00:00:00 2001 From: Joshua Hairston Date: Thu, 13 Nov 2025 13:16:51 -0500 Subject: [PATCH 08/13] added models and serializer --- .../migrations/0005_instrumentconfig.py | 30 +++++++++++++++++++ .../0006_delete_instrumentconfig.py | 16 ++++++++++ teleband/users/api/serializers.py | 8 +++++ .../users/migrations/0011_instrumentconfig.py | 30 +++++++++++++++++++ teleband/users/models.py | 9 ++++++ 5 files changed, 93 insertions(+) create mode 100644 teleband/instruments/migrations/0005_instrumentconfig.py create mode 100644 teleband/instruments/migrations/0006_delete_instrumentconfig.py create mode 100644 teleband/users/migrations/0011_instrumentconfig.py diff --git a/teleband/instruments/migrations/0005_instrumentconfig.py b/teleband/instruments/migrations/0005_instrumentconfig.py new file mode 100644 index 0000000..3043df9 --- /dev/null +++ b/teleband/instruments/migrations/0005_instrumentconfig.py @@ -0,0 +1,30 @@ +# Generated by Django 5.0.6 on 2025-11-13 15:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("instruments", "0004_instrument_midi_program_number"), + ] + + operations = [ + migrations.CreateModel( + name="InstrumentConfig", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(max_length=20)), + ("description", models.CharField(max_length=100)), + ("settings", models.JSONField(default=dict)), + ], + ), + ] diff --git a/teleband/instruments/migrations/0006_delete_instrumentconfig.py b/teleband/instruments/migrations/0006_delete_instrumentconfig.py new file mode 100644 index 0000000..7163067 --- /dev/null +++ b/teleband/instruments/migrations/0006_delete_instrumentconfig.py @@ -0,0 +1,16 @@ +# Generated by Django 5.0.6 on 2025-11-13 17:39 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("instruments", "0005_instrumentconfig"), + ] + + operations = [ + migrations.DeleteModel( + name="InstrumentConfig", + ), + ] diff --git a/teleband/users/api/serializers.py b/teleband/users/api/serializers.py index e3379a4..ede0b48 100644 --- a/teleband/users/api/serializers.py +++ b/teleband/users/api/serializers.py @@ -4,6 +4,8 @@ from teleband.instruments.api.serializers import InstrumentSerializer from teleband.utils.serializers import GenericNameSerializer +from teleband.users.models import InstrumentConfig + User = get_user_model() @@ -35,3 +37,9 @@ class UserInstrumentSerializer(serializers.ModelSerializer): class Meta: model = User fields = ["id", "name", "instrument", "external_id", "grade"] + + +class UserInstrumentConfigSerializer(serializers.ModelSerializer): + class Meta: + model = InstrumentConfig + fields = ["name", "description", "settings"] diff --git a/teleband/users/migrations/0011_instrumentconfig.py b/teleband/users/migrations/0011_instrumentconfig.py new file mode 100644 index 0000000..184ce8a --- /dev/null +++ b/teleband/users/migrations/0011_instrumentconfig.py @@ -0,0 +1,30 @@ +# Generated by Django 5.0.6 on 2025-11-13 17:39 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("users", "0010_alter_user_external_id"), + ] + + operations = [ + migrations.CreateModel( + name="InstrumentConfig", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.CharField(max_length=20)), + ("description", models.CharField(max_length=100)), + ("settings", models.JSONField(default=dict)), + ], + ), + ] diff --git a/teleband/users/models.py b/teleband/users/models.py index acb438d..d9a3ecd 100644 --- a/teleband/users/models.py +++ b/teleband/users/models.py @@ -48,3 +48,12 @@ def __str__(self): class GroupInvitation(Invitation): group = models.ForeignKey(Group, on_delete=models.DO_NOTHING) + + +class InstrumentConfig(models.Model): + name = models.CharField(max_length=20) + description = models.CharField(max_length=100) + settings = models.JSONField(default=dict) + + def __str__(self): + return self.name From 6d45e602a73cc72cb5c0ba24c470bf154681f4e0 Mon Sep 17 00:00:00 2001 From: Joshua Hairston Date: Fri, 16 Jan 2026 16:14:33 -0500 Subject: [PATCH 09/13] added serializer and viewset for the instrument config, as well as changing the route of the configs --- config/api_router.py | 5 ++++ docs/api.md | 4 ++-- teleband/users/api/serializers.py | 3 +-- teleband/users/api/views.py | 18 +++++++++++--- .../migrations/0012_instrumentconfig_user.py | 24 +++++++++++++++++++ teleband/users/models.py | 1 + 6 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 teleband/users/migrations/0012_instrumentconfig_user.py diff --git a/config/api_router.py b/config/api_router.py index 63fa6c3..08665cb 100644 --- a/config/api_router.py +++ b/config/api_router.py @@ -19,6 +19,7 @@ ) from teleband.musics.api.views import PieceViewSet from teleband.instruments.api.views import InstrumentViewSet +from teleband.users.api.views import UserInstrumentConfigViewSet if settings.DEBUG: router = DefaultRouter() @@ -33,6 +34,7 @@ router.register("pieces", PieceViewSet) router.register("piece-plans", PiecePlanViewSet) router.register("instruments", InstrumentViewSet) +router.register("configs", UserInstrumentConfigViewSet) courses_router = nested_cls(router, "courses", lookup="course_slug") courses_router.register("assignments", AssignmentViewSet) # option basename omitted @@ -49,6 +51,9 @@ attachments_router = nested_cls(assignments_router, "submissions", lookup="submission") attachments_router.register("attachments", AttachmentViewSet) +# config_router = nested_cls(router, "users", lookup="user_username") +# config_router.register("configs", UserInstrumentConfigViewSet) + app_name = "api" urlpatterns = router.urls urlpatterns += [ diff --git a/docs/api.md b/docs/api.md index 8cac8c7..8e8f89f 100644 --- a/docs/api.md +++ b/docs/api.md @@ -55,8 +55,8 @@ Remove a user/role/course enrollment curl -v \ --request GET \ --header 'Content-Type: application/json' \ --H 'Authorization: Token e9a82a7c334fbdfc52f502efebebec474708eef0' \ -https://dev-api.tele.band/api/pieces/ && echo "\n" +-H 'Authorization: Token a2ffdae8df89b2909eb03d21cec559e95eba2e44' \ +http://127.0.0.1:8000/api/configs/ && echo "\n" ``` diff --git a/teleband/users/api/serializers.py b/teleband/users/api/serializers.py index ede0b48..efb3aa7 100644 --- a/teleband/users/api/serializers.py +++ b/teleband/users/api/serializers.py @@ -6,7 +6,6 @@ from teleband.utils.serializers import GenericNameSerializer from teleband.users.models import InstrumentConfig - User = get_user_model() @@ -42,4 +41,4 @@ class Meta: class UserInstrumentConfigSerializer(serializers.ModelSerializer): class Meta: model = InstrumentConfig - fields = ["name", "description", "settings"] + fields = ["id", "name", "description", "settings"] diff --git a/teleband/users/api/views.py b/teleband/users/api/views.py index 988cdc0..0c37fa0 100644 --- a/teleband/users/api/views.py +++ b/teleband/users/api/views.py @@ -12,7 +12,7 @@ from rest_framework.decorators import action from rest_framework.mixins import ListModelMixin, RetrieveModelMixin, UpdateModelMixin from rest_framework.response import Response -from rest_framework.viewsets import GenericViewSet +from rest_framework.viewsets import GenericViewSet, ModelViewSet from rest_framework.authtoken.models import Token from rest_framework.authtoken.views import ObtainAuthToken @@ -21,9 +21,13 @@ from invitations.exceptions import AlreadyAccepted, AlreadyInvited, UserRegisteredEmail from invitations.forms import CleanEmailMixin -from .serializers import UserSerializer, UserInstrumentSerializer +from .serializers import ( + UserSerializer, + UserInstrumentSerializer, + UserInstrumentConfigSerializer, +) from teleband.courses.models import Enrollment, Course - +from teleband.users.models import InstrumentConfig User = get_user_model() Invitation = get_invitation_model() @@ -125,4 +129,12 @@ def delete(self, request, *args, **kwargs): return Response(status=status.HTTP_404_NOT_FOUND) +class UserInstrumentConfigViewSet(ModelViewSet): + serializer_class = UserInstrumentConfigSerializer + queryset = InstrumentConfig.objects.all() + + def get_queryset(self): + return self.request.user.instrumentconfig_set.all() + + obtain_delete_auth_token = ObtainDeleteAuthToken.as_view() diff --git a/teleband/users/migrations/0012_instrumentconfig_user.py b/teleband/users/migrations/0012_instrumentconfig_user.py new file mode 100644 index 0000000..0e7984d --- /dev/null +++ b/teleband/users/migrations/0012_instrumentconfig_user.py @@ -0,0 +1,24 @@ +# Generated by Django 5.0.6 on 2025-11-20 14:21 + +import django.db.models.deletion +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("users", "0011_instrumentconfig"), + ] + + operations = [ + migrations.AddField( + model_name="instrumentconfig", + name="user", + field=models.ForeignKey( + null=True, + on_delete=django.db.models.deletion.CASCADE, + to=settings.AUTH_USER_MODEL, + ), + ), + ] diff --git a/teleband/users/models.py b/teleband/users/models.py index d9a3ecd..538327c 100644 --- a/teleband/users/models.py +++ b/teleband/users/models.py @@ -54,6 +54,7 @@ class InstrumentConfig(models.Model): name = models.CharField(max_length=20) description = models.CharField(max_length=100) settings = models.JSONField(default=dict) + user = models.ForeignKey(User, null=True, on_delete=models.CASCADE) def __str__(self): return self.name From 96a2885c310e820923848eaa6b03d6c37fe9b001 Mon Sep 17 00:00:00 2001 From: Joshua Hairston Date: Sun, 1 Feb 2026 20:21:36 -0500 Subject: [PATCH 10/13] added instrumentconfig stuff for th user to be added to the object in the frontend --- teleband/users/api/views.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/teleband/users/api/views.py b/teleband/users/api/views.py index 0c37fa0..6221a22 100644 --- a/teleband/users/api/views.py +++ b/teleband/users/api/views.py @@ -136,5 +136,9 @@ class UserInstrumentConfigViewSet(ModelViewSet): def get_queryset(self): return self.request.user.instrumentconfig_set.all() + # this helped to map the configs to the user creating them + def perform_create(self, serializer): + return serializer.save(user=self.request.user) + obtain_delete_auth_token = ObtainDeleteAuthToken.as_view() From bcc08cc4a51af9e000a551b46f3646890b5d08e7 Mon Sep 17 00:00:00 2001 From: Joshua Hairston Date: Wed, 1 Apr 2026 13:26:06 -0400 Subject: [PATCH 11/13] added to the serializer and to the models.py for the audio picker in the frontend --- teleband/users/api/serializers.py | 2 +- .../migrations/0013_instrumentconfig_file.py | 20 +++++++++++++++++++ teleband/users/models.py | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 teleband/users/migrations/0013_instrumentconfig_file.py diff --git a/teleband/users/api/serializers.py b/teleband/users/api/serializers.py index efb3aa7..654c952 100644 --- a/teleband/users/api/serializers.py +++ b/teleband/users/api/serializers.py @@ -41,4 +41,4 @@ class Meta: class UserInstrumentConfigSerializer(serializers.ModelSerializer): class Meta: model = InstrumentConfig - fields = ["id", "name", "description", "settings"] + fields = ["id", "name", "description", "settings", "file"] diff --git a/teleband/users/migrations/0013_instrumentconfig_file.py b/teleband/users/migrations/0013_instrumentconfig_file.py new file mode 100644 index 0000000..05bcf44 --- /dev/null +++ b/teleband/users/migrations/0013_instrumentconfig_file.py @@ -0,0 +1,20 @@ +# Generated by Django 5.0.6 on 2026-03-30 11:09 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("users", "0012_instrumentconfig_user"), + ] + + operations = [ + migrations.AddField( + model_name="instrumentconfig", + name="file", + field=models.FileField( + blank=True, null=True, upload_to="instrument_config_samples/" + ), + ), + ] diff --git a/teleband/users/models.py b/teleband/users/models.py index 538327c..a0001b1 100644 --- a/teleband/users/models.py +++ b/teleband/users/models.py @@ -54,6 +54,7 @@ class InstrumentConfig(models.Model): name = models.CharField(max_length=20) description = models.CharField(max_length=100) settings = models.JSONField(default=dict) + file = models.FileField(upload_to="instrument_config_samples/", null=True, blank=True) user = models.ForeignKey(User, null=True, on_delete=models.CASCADE) def __str__(self): From af0d7094e6b0f9a4e43b7e25b83a87f02ac65e12 Mon Sep 17 00:00:00 2001 From: Joshua Ahmath Hairston Date: Mon, 20 Apr 2026 12:48:40 -0400 Subject: [PATCH 12/13] made it to where the description isn't required --- .../0014_alter_instrumentconfig_description.py | 18 ++++++++++++++++++ teleband/users/models.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 teleband/users/migrations/0014_alter_instrumentconfig_description.py diff --git a/teleband/users/migrations/0014_alter_instrumentconfig_description.py b/teleband/users/migrations/0014_alter_instrumentconfig_description.py new file mode 100644 index 0000000..86a55c9 --- /dev/null +++ b/teleband/users/migrations/0014_alter_instrumentconfig_description.py @@ -0,0 +1,18 @@ +# Generated by Django 5.0.6 on 2026-04-20 16:23 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("users", "0013_instrumentconfig_file"), + ] + + operations = [ + migrations.AlterField( + model_name="instrumentconfig", + name="description", + field=models.CharField(blank=True, max_length=100, null=True), + ), + ] diff --git a/teleband/users/models.py b/teleband/users/models.py index a0001b1..9597523 100644 --- a/teleband/users/models.py +++ b/teleband/users/models.py @@ -52,7 +52,7 @@ class GroupInvitation(Invitation): class InstrumentConfig(models.Model): name = models.CharField(max_length=20) - description = models.CharField(max_length=100) + description = models.CharField(max_length=100, null=True, blank=True) settings = models.JSONField(default=dict) file = models.FileField(upload_to="instrument_config_samples/", null=True, blank=True) user = models.ForeignKey(User, null=True, on_delete=models.CASCADE) From a97e903ebc79f4e052914a3eaaac3ddbf81e55c1 Mon Sep 17 00:00:00 2001 From: Joshua Ahmath Hairston Date: Mon, 20 Apr 2026 21:25:04 -0400 Subject: [PATCH 13/13] added a data migration which gives all users a trumpet config to work with --- teleband/users/admin.py | 4 +++- teleband/users/api/views.py | 5 +++- .../migrations/0015_auto_20260420_1659.py | 24 +++++++++++++++++++ .../0016_update_default_config_description.py | 14 +++++++++++ 4 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 teleband/users/migrations/0015_auto_20260420_1659.py create mode 100644 teleband/users/migrations/0016_update_default_config_description.py diff --git a/teleband/users/admin.py b/teleband/users/admin.py index 1112a8d..956fe9a 100644 --- a/teleband/users/admin.py +++ b/teleband/users/admin.py @@ -8,7 +8,7 @@ from teleband.users.forms import UserChangeForm, UserCreationForm from teleband.users.models import Role, GroupInvitation from teleband.courses.models import Enrollment - +from teleband.users.models import InstrumentConfig User = get_user_model() @@ -51,3 +51,5 @@ class UserAdmin(auth_admin.UserAdmin): class RoleAdmin(VersionAdmin): list_display = ("id", "name") search_fields = ("name",) + +admin.site.register(InstrumentConfig) \ No newline at end of file diff --git a/teleband/users/api/views.py b/teleband/users/api/views.py index 1c3a7c3..e4a0f6f 100644 --- a/teleband/users/api/views.py +++ b/teleband/users/api/views.py @@ -30,6 +30,8 @@ from teleband.courses.models import Enrollment, Course from teleband.users.models import InstrumentConfig +from django.db.models import Q + User = get_user_model() Invitation = get_invitation_model() @@ -149,7 +151,8 @@ class UserInstrumentConfigViewSet(ModelViewSet): queryset = InstrumentConfig.objects.all() def get_queryset(self): - return self.request.user.instrumentconfig_set.all() + # this returns all configs for the user and the default confgis (those with user=None) + return InstrumentConfig.objects.filter(Q(user=self.request.user) | Q(user=None)) # this helped to map the configs to the user creating them def perform_create(self, serializer): diff --git a/teleband/users/migrations/0015_auto_20260420_1659.py b/teleband/users/migrations/0015_auto_20260420_1659.py new file mode 100644 index 0000000..7377fdf --- /dev/null +++ b/teleband/users/migrations/0015_auto_20260420_1659.py @@ -0,0 +1,24 @@ +# Generated by Django 5.0.6 on 2026-04-20 20:59 + +from django.db import migrations +defaultConfigs = [ + { + "name": "Roland-GR-1-Trumpet", + "settings": {}, + "file": "instrument_config_samples/Roland-GR-1-Trumpet-C5.wav", + "user": None + } + ] + +def update_site_forward(apps, schema_editor): + instrument_config_model = apps.get_model("users", "InstrumentConfig") + for config in defaultConfigs: + instrument_config_model.objects.create(**config) + +class Migration(migrations.Migration): + + dependencies = [ + ("users", "0014_alter_instrumentconfig_description"), + ] + + operations = [migrations.RunPython(update_site_forward)] diff --git a/teleband/users/migrations/0016_update_default_config_description.py b/teleband/users/migrations/0016_update_default_config_description.py new file mode 100644 index 0000000..818a602 --- /dev/null +++ b/teleband/users/migrations/0016_update_default_config_description.py @@ -0,0 +1,14 @@ +# Generated by Django 5.0.6 on 2026-04-21 01:21 + +from django.db import migrations + +def update_site_forward(apps, schema_editor): + instrument_config_model = apps.get_model("users", "InstrumentConfig") + instrument_config_model.objects.filter(name="Roland-GR-1-Trumpet", user=None).update(description="Default Roland GR-1 Trumpet configuration.") +class Migration(migrations.Migration): + + dependencies = [ + ("users", "0015_auto_20260420_1659"), + ] + + operations = [migrations.RunPython(update_site_forward)]