Skip to content

Commit

Permalink
Merge pull request #146 from DDMAL/img_compression
Browse files Browse the repository at this point in the history
feat: update instr list & increase instr name lgth
  • Loading branch information
kunfang98927 authored Aug 16, 2024
2 parents 2d4e533 + 7105e67 commit ffec86a
Show file tree
Hide file tree
Showing 6 changed files with 881 additions and 266 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Command(BaseCommand):
OUTPUT_DIR = os.path.join(
settings.STATIC_ROOT, "instruments", "images", "instrument_imgs"
)
CSV_PATH = "startup_data/vim_instruments_with_images-15sept.csv"
CSV_PATH = "startup_data/all_instruments_16aug_2024.csv"

help = "Download images and create thumbnails for instruments"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ def create_database_objects(

def handle(self, *args, **options) -> None:
with open(
"startup_data/vim_instruments_with_images-15sept.csv", encoding="utf-8-sig"
"startup_data/all_instruments_16aug_2024.csv",
encoding="utf-8-sig",
) as csvfile:
reader = csv.DictReader(csvfile)
instrument_list: list[dict] = list(reader)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.2.5 on 2024-08-16 16:37

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("instruments", "0002_instrument_thumbnail"),
]

operations = [
migrations.AlterField(
model_name="instrumentname",
name="name",
field=models.CharField(max_length=100),
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class InstrumentName(models.Model):
instrument = models.ForeignKey("Instrument", on_delete=models.CASCADE)
language = models.ForeignKey("Language", on_delete=models.PROTECT)
name = models.CharField(max_length=50, blank=False)
name = models.CharField(max_length=100, blank=False)
source_name = models.CharField(
max_length=50, blank=False, help_text="Who or what called the instrument this?"
) # Stand-in for source data; format TBD
Loading

0 comments on commit ffec86a

Please sign in to comment.