Skip to content

Commit e94ca8a

Browse files
authored
Merge pull request #25 from Lab-Lab-Lab/main
add partinstrumentsample to admin and create its migration
2 parents 115b095 + 84838bc commit e94ca8a

File tree

3 files changed

+69
-2
lines changed

3 files changed

+69
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ The following details how to deploy this application.
128128

129129
# Renewing SSL Certs (requires creating DNS TXT Entries rn 😕)
130130
1. maybe this is the command?
131-
* `sudo certbot certonly --manual --server https://acme-v02.api.letsencrypt.org/directory --preferred-challenges dns-01 -d "*.musiccpr.org,musiccpr.org"`
131+
* `sudo certbot certonly --manual --server https://acme-v02.api.letsencrypt.org/directory --preferred-challenges dns-01 -d "musiccpr.org,dev-api.musiccpr.org,dev.musiccpr.org,api.musiccpr.org"`
132132
# Deploying to Prod first time
133133
Prefer to have:
134134
1. same ec2 instance as dev

teleband/musics/admin.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
from django.contrib import admin
22
from reversion.admin import VersionAdmin
33

4-
from .models import EnsembleType, Composer, Piece, PartType, Part, PartTransposition
4+
from .models import (
5+
EnsembleType,
6+
Composer,
7+
PartInstrumentSample,
8+
Piece,
9+
PartType,
10+
Part,
11+
PartTransposition,
12+
)
513

614

715
@admin.register(EnsembleType)
@@ -49,3 +57,9 @@ class PartAdmin(VersionAdmin):
4957
class PartTranspositionAdmin(VersionAdmin):
5058
list_display = ("id", "part", "transposition", "flatio")
5159
list_filter = ("part", "transposition")
60+
61+
62+
@admin.register(PartInstrumentSample)
63+
class PartInstrumentSampleAdmin(VersionAdmin):
64+
list_display = ("id", "part", "instrument", "sample_audio")
65+
list_filter = ("part", "instrument")
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Generated by Django 5.0.6 on 2024-10-27 02:47
2+
3+
import django.db.models.deletion
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
("instruments", "0004_instrument_midi_program_number"),
11+
(
12+
"musics",
13+
"0027_correct_accompaniment_2040_and_deep_river_color_pattern_20240317_1712",
14+
),
15+
]
16+
17+
operations = [
18+
migrations.CreateModel(
19+
name="PartInstrumentSample",
20+
fields=[
21+
(
22+
"id",
23+
models.BigAutoField(
24+
auto_created=True,
25+
primary_key=True,
26+
serialize=False,
27+
verbose_name="ID",
28+
),
29+
),
30+
("sample_audio", models.FileField(upload_to="instrument_samples/")),
31+
(
32+
"instrument",
33+
models.ForeignKey(
34+
on_delete=django.db.models.deletion.PROTECT,
35+
to="instruments.instrument",
36+
),
37+
),
38+
(
39+
"part",
40+
models.ForeignKey(
41+
on_delete=django.db.models.deletion.PROTECT,
42+
related_name="instrument_samples",
43+
to="musics.part",
44+
),
45+
),
46+
],
47+
options={
48+
"verbose_name": "Part Instrument Sample",
49+
"verbose_name_plural": "Part Instrument Samples",
50+
"unique_together": {("part", "instrument")},
51+
},
52+
),
53+
]

0 commit comments

Comments
 (0)