Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
29a11fa
fix: remove Google Tag installation & add GTM
yinanazhou Jul 28, 2025
d7da7ac
Merge pull request #315 from DDMAL/gtm-init
yinanazhou Jul 29, 2025
232c5df
feat: update instrument name with boolean flag indicating new data (i…
mailynmailyn May 21, 2025
d7ecb4f
feat: create InstrumentAlias model, with FK InstrumentName
mailynmailyn May 21, 2025
f92f538
feat: update InstrumentName to indicate alias with boolean flag
mailynmailyn May 21, 2025
91c4c79
feat: implement functions to add label with/without alias, or only ad…
mailynmailyn May 21, 2025
a1f9285
fix: update data parsing to reflect expected json request body
mailynmailyn May 29, 2025
e7af08b
feat: saving name to database
mailynmailyn May 29, 2025
a129e22
feat: differentiating between label and alias
mailynmailyn May 29, 2025
ed0c907
feat: InstrumentName fields
mailynmailyn May 29, 2025
aee2cf2
fix: remove InstrumentAlias
mailynmailyn May 30, 2025
280c48d
feat: use django admin to restrict user editing access
mailynmailyn May 30, 2025
cbb4bd2
migration: add InstrumentName fields
mailynmailyn May 30, 2025
21210c0
feat: Add InstrumentName object to database
mailynmailyn Jun 2, 2025
33832e8
feat: view new verified InstrumentNames
mailynmailyn Jun 2, 2025
c514aeb
feat: Authorize UMIL client (OAuth)
mailynmailyn Jun 9, 2025
5c0b02f
fix: rename view to better describe class (edit_wikidata to verified_…
mailynmailyn Jun 10, 2025
669377d
feat: button to submit to wikidata
mailynmailyn Jun 10, 2025
9801e12
feat: edit wikidata instrument names with verified data entries
mailynmailyn Jun 11, 2025
8f74f43
fix: missing bracket
mailynmailyn Jun 11, 2025
c33041d
fix: associate add-name url to a specific instrument pk
mailynmailyn Jun 16, 2025
cf325f9
fix: Reformat status field to conform with new terminology
mailynmailyn Jun 16, 2025
c49d1a6
feat: add button that triggers add_name modal
mailynmailyn Jun 19, 2025
76df183
fix: adjust form fields to only allow user input for language, name a…
mailynmailyn Jun 19, 2025
7436858
feat: define post request for instrument detail page.
mailynmailyn Jun 19, 2025
90014fe
feat: define modal template
mailynmailyn Jun 19, 2025
1f9b1be
initialize pre-existing js for adding an instrument name
mailynmailyn Jun 19, 2025
c653042
feat: add new instrument name
mailynmailyn Jun 25, 2025
0d0fce2
fix: rename verified_instruments view to approved_instruments
mailynmailyn Jun 25, 2025
1e45b1f
feat: function to add new name entry to UMILdb
mailynmailyn Jun 25, 2025
47197be
feat: adjust css for add instrument button
mailynmailyn Jun 25, 2025
c08c781
feat: javascript function to check if user input already exists on wi…
mailynmailyn Jun 25, 2025
88d79b4
fix: validation text and publish message formatting
mailynmailyn Jun 26, 2025
06f1fce
feat: edit wikidata frontend
mailynmailyn Jun 26, 2025
973252c
fix: display label in active language (not alias)
mailynmailyn Jun 26, 2025
37b8302
feat: allow user to delete their own instrument name entries
mailynmailyn Jun 30, 2025
6aeb770
chore: force user to login in order to access 'add name modal'
mailynmailyn Jul 2, 2025
0dd702f
fix: change button colouring to fit theme
mailynmailyn Jul 2, 2025
427adbb
fix: align remove button with input fields
mailynmailyn Jul 2, 2025
fdaf377
chore: add nav element to access edit-wikidata page
mailynmailyn Jul 2, 2025
65a984b
chore: restrict access to upload page for superusers only
mailynmailyn Jul 2, 2025
0ca0b05
chore: clean up delete name feature
mailynmailyn Jul 2, 2025
8938122
fix: remove print test statements
mailynmailyn Jul 3, 2025
9362c17
fix: only load modal once
mailynmailyn Jul 3, 2025
56401f7
feat: wikibase connection settings
mailynmailyn Jul 3, 2025
5dada8f
feat: allow superuser to delete instrument names on upload page
mailynmailyn Jul 3, 2025
be6317a
chore: remove wikidata functionalities
mailynmailyn Jul 3, 2025
a1a0773
chore: disable registration button
mailynmailyn Jul 3, 2025
f9425c2
chore: separate delete name ts into separate file
mailynmailyn Jul 3, 2025
bf24be0
chore: add comments to data entry functionalities
mailynmailyn Jul 3, 2025
3abc8c3
fix: convert javascript to typescript
mailynmailyn Jul 3, 2025
cd92d8f
fix: button styling and formatting
mailynmailyn Jul 3, 2025
4beb32c
fix: javascript to typescript and bootstrap modal API
mailynmailyn Jul 3, 2025
36c0ac8
fix: bootstrap modal API
mailynmailyn Jul 3, 2025
6508128
ci: make djlint log filename only
yinanazhou Jul 3, 2025
c16e78d
chore: reformat frontend files
yinanazhou Jul 3, 2025
a66b721
fix: remove detail.css and fix button
mailynmailyn Jul 3, 2025
dfc536c
chore: reformat py files
yinanazhou Jul 3, 2025
770a701
chore: reformat `update_umil_db.py`
yinanazhou Jul 3, 2025
e689891
chore: rename & move `addName.html&deleteName.html` to includes/
yinanazhou Jul 3, 2025
ce7a7f7
style: move add name button into table
yinanazhou Jul 3, 2025
194ee9b
style: improve instrument detail UI and responsive design
yinanazhou Jul 3, 2025
d200efd
build: add delete name mapping to vite config
yinanazhou Jul 4, 2025
74b20be
fix: correct link to mimo class
mailynmailyn Jul 5, 2025
548fb17
fix: instrument label on modal
mailynmailyn Jul 7, 2025
a72d6bc
fix: modify prettier to user django/jinja formatter for .html files
mailynmailyn Jul 7, 2025
57eefdf
Revert "fix: instrument label on modal"
mailynmailyn Jul 8, 2025
5aba7fd
refactor: modularize `InstrumentDetail.ts` and rename to `AddName.ts`
yinanazhou Jul 10, 2025
96a1e1f
refactor: modularize `DeleteName.ts`
yinanazhou Jul 10, 2025
6b1e311
chore: re-enable registration button
mailynmailyn Jul 11, 2025
1ad29b6
chore: remove comment
mailynmailyn Jul 14, 2025
79a4227
chore: ensure there is always an associated user when account is created
mailynmailyn Jul 14, 2025
2dd3aba
chore: ensure function only activated via POST request
mailynmailyn Jul 14, 2025
ff58c37
chore: protect user accounts
mailynmailyn Jul 14, 2025
5413d4c
fix: delete name exceptions
mailynmailyn Jul 14, 2025
7762170
fix: always returning 400 error in delete function
mailynmailyn Jul 15, 2025
eb7a980
chore: method requirement redundancy
mailynmailyn Jul 15, 2025
5c53c1c
fix: allow admin to delete any name
mailynmailyn Jul 15, 2025
919d111
refactor: batch upload instrument names to UMILdb
mailynmailyn Jul 15, 2025
845437a
chore: type annotations
mailynmailyn Jul 16, 2025
4737eef
feat: reference same url for adding and deleting instrument names
mailynmailyn Jul 17, 2025
fe41bf9
fix: AddName.ts formatting
mailynmailyn Jul 17, 2025
4a90b23
feat: alias-label tracking data model change
mailynmailyn Jul 17, 2025
6669d84
fix: always set instrument label value
mailynmailyn Jul 22, 2025
4f64875
fix: use django's built in get_object_or_404 method
mailynmailyn Jul 24, 2025
e17460a
fix: remove exception
mailynmailyn Jul 24, 2025
7521afb
fix: allow user to enter multiple names of the same language
mailynmailyn Jul 24, 2025
248f1d5
chore: remove "no contributor exception"
mailynmailyn Jul 25, 2025
3526085
chore: remove `is_approved` and rename `status` for InstrumentName model
mailynmailyn Jul 25, 2025
291a4a6
fix: remove type indicator in AddName modal confirmation
mailynmailyn Jul 28, 2025
5b3539c
fix: instrument detail formatting
mailynmailyn Jul 29, 2025
053a772
fix: remove reference to start-up.sh
mailynmailyn Jul 29, 2025
ee1c087
fix: refer to AddName.ts, not InstrumentDetail.ts
mailynmailyn Jul 29, 2025
4662e95
fix: prettier and black formatting
mailynmailyn Jul 29, 2025
3f94256
Merge pull request #259 from DDMAL/ich-demo-rebase
mailynmailyn Jul 29, 2025
0666b6e
fix: unify search query param to `query`
yinanazhou Jul 30, 2025
53072c9
Merge pull request #328 from DDMAL/pagi-fix
yinanazhou Jul 31, 2025
d64cd30
feat: custom pagination for Solr search result
yinanazhou Jul 30, 2025
52444b9
perf: remove redundant language code query
yinanazhou Jul 31, 2025
e8baf1f
Merge pull request #331 from DDMAL/solr-limit
yinanazhou Jul 31, 2025
317c8d5
fix: adjust model by assigning default contributor
kunfang98927 Aug 4, 2025
19a94d4
fix: keep contributor `null=True` temporarily before data import
kunfang98927 Aug 7, 2025
d2377c9
Merge pull request #325 from DDMAL/default-contributor
kunfang98927 Aug 8, 2025
692813d
feat: add status column to instrument detail page that displays the `…
mailynmailyn Aug 5, 2025
f9e0ac1
feat: bootstrap badge styling of verification status
mailynmailyn Aug 5, 2025
fdffd73
feat: verification status info modal
mailynmailyn Aug 5, 2025
38ad15e
feat: differentiate "under review" from "needs additional review"
mailynmailyn Aug 6, 2025
48546f9
feat: status viewing permissions
mailynmailyn Aug 6, 2025
5c3d648
fix: python format
mailynmailyn Aug 7, 2025
9bf950f
chore: specify status type
mailynmailyn Aug 8, 2025
42d9f10
refactors: show all names of all status to users with a UMIL account
mailynmailyn Aug 8, 2025
d3ef2a0
fix: extract umil_label from filtered list
mailynmailyn Aug 8, 2025
0ac654b
Update web-app/django/VIM/apps/instruments/views/instrument_detail.py
mailynmailyn Aug 8, 2025
464b602
refactor: python format
mailynmailyn Aug 8, 2025
34ae78d
refactor: reduce redundant SQL query
mailynmailyn Aug 8, 2025
77598be
chore: create migration file
mailynmailyn Aug 11, 2025
4635bba
ci: remove unnecessary grep filtering in django html format check
yinanazhou Aug 11, 2025
620a8de
chore: reformat
yinanazhou Aug 11, 2025
1f622c2
style: minor adjustment for verification flag
yinanazhou Aug 11, 2025
f8e1195
Merge pull request #339 from DDMAL/verification-flag
mailynmailyn Aug 11, 2025
2d009d3
Production CD Github Action (#346)
notkaramel Aug 12, 2025
0262ad5
Update Staging CD to build Docker with no cache (#345)
notkaramel Aug 12, 2025
48baa42
Remove trailing spaces that interrupt CD Actions (#349)
notkaramel Aug 12, 2025
a2ef2dc
style: keep image aspect ratio in std view
yinanazhou Aug 13, 2025
1759741
style: set min height for content container
yinanazhou Aug 13, 2025
e40be10
Merge pull request #351 from DDMAL/img-fix
yinanazhou Aug 14, 2025
42c8c4f
Merge pull request #353 from DDMAL/height-fix
yinanazhou Aug 14, 2025
f5792d9
Visitez le site en *français* typo fix (#355)
notkaramel Aug 15, 2025
d6b9f28
Change folder name for CD on production server (#356)
notkaramel Aug 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/cd_prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy to Production Server
on: workflow_dispatch

concurrency:
group: production
cancel-in-progress: true

jobs:
deploy-production:
runs-on: ubuntu-latest
steps:
- name: Checkout the current repo
uses: actions/checkout@v5
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- name: Stop the current Docker containers running
run: |
ssh -J ${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST1 }},${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST_PROD }} ${{ secrets.USERNAME }}@${{ secrets.HOST_PROD }} \
"cd /virtual-instrument-museum &&
sudo docker compose stop"
- name: Fetch new updates from remote `origin` and log current branches
run: |
ssh -J ${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST1 }},${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST_PROD }} ${{ secrets.USERNAME }}@${{ secrets.HOST_PROD }} \
"cd /virtual-instrument-museum &&
sudo git fetch origin -v &&
sudo git branch -v"
- name: Checkout to `main` branch and pull new changes
run: |
ssh -J ${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST1 }},${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST_PROD }} ${{ secrets.USERNAME }}@${{ secrets.HOST_PROD }} \
"cd /virtual-instrument-museum &&
sudo git checkout main &&
sudo git pull origin main"
- name: Build docker images
run: |
ssh -J ${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST1 }},${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST_PROD }} ${{ secrets.USERNAME }}@${{ secrets.HOST_PROD }} \
"cd /virtual-instrument-museum &&
sudo docker compose build --no-cache"
- name: Start the services
run: |
ssh -J ${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST1 }},${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST_PROD }} ${{ secrets.USERNAME }}@${{ secrets.HOST_PROD }} \
"cd /virtual-instrument-museum &&
sudo docker compose up -d"
23 changes: 17 additions & 6 deletions .github/workflows/cd_stage.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Deploy to staging Server
on:
on:
push:
branches:
- "develop"
Expand All @@ -21,16 +21,27 @@ jobs:
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- name: Stop docker swarm and cleanup services
run: |
ssh -J ${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST1 }},${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST2 }} ${{ secrets.USERNAME }}@${{ secrets.HOST }} "cd /virtual_instrument_museum && sudo docker compose stop"
ssh -J ${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST1 }},${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST2 }} ${{ secrets.USERNAME }}@${{ secrets.HOST }} \
"cd /virtual_instrument_museum &&
sudo docker compose stop"
- name: Log git branch we're on
run: |
ssh -J ${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST1 }},${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST2 }} ${{ secrets.USERNAME }}@${{ secrets.HOST }} "cd /virtual_instrument_museum && sudo git branch --all -v"
ssh -J ${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST1 }},${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST2 }} ${{ secrets.USERNAME }}@${{ secrets.HOST }} \
"cd /virtual_instrument_museum &&
sudo git branch --all -v"
- name: Fetch on dev branch
run: |
ssh -J ${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST1 }},${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST2 }} ${{ secrets.USERNAME }}@${{ secrets.HOST }} "cd /virtual_instrument_museum && sudo git fetch origin develop && sudo git merge origin/develop"
ssh -J ${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST1 }},${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST2 }} ${{ secrets.USERNAME }}@${{ secrets.HOST }} \
"cd /virtual_instrument_museum &&
sudo git fetch origin develop &&
sudo git merge origin/develop"
- name: Build docker images
run: |
ssh -J ${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST1 }},${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST2 }} ${{ secrets.USERNAME }}@${{ secrets.HOST }} "cd /virtual_instrument_museum && sudo docker compose build"
ssh -J ${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST1 }},${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST2 }} ${{ secrets.USERNAME }}@${{ secrets.HOST }} \
"cd /virtual_instrument_museum &&
sudo docker compose build --no-cache"
- name: Start the service
run: |
ssh -J ${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST1 }},${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST2 }} ${{ secrets.USERNAME }}@${{ secrets.HOST }} "cd /virtual_instrument_museum && sudo docker compose up -d"
ssh -J ${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST1 }},${{ secrets.PROXY_USERNAME }}@${{ secrets.PROXY_HOST2 }} ${{ secrets.USERNAME }}@${{ secrets.HOST }} \
"cd /virtual_instrument_museum &&
sudo docker compose up -d"
4 changes: 3 additions & 1 deletion .github/workflows/frontend_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ jobs:
run: poetry install --no-root

- name: Run djlint via Poetry
run: poetry run djlint . --check --extension html --exclude "migrations/*"
run: |
cd web-app/django/VIM/templates/
poetry run djlint . --check --extension html --exclude "migrations/*"

- name: Set up Node.js
uses: actions/setup-node@v4
Expand Down
3 changes: 3 additions & 0 deletions prettierrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ overrides:
- files: "*.js"
options:
trailingComma: "es5"
- files: "*.html"
options:
parser: django
27 changes: 26 additions & 1 deletion web-app/django/VIM/apps/instruments/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@
from VIM.apps.instruments.models import Instrument, InstrumentName, Language, AVResource

admin.site.register(Instrument)
admin.site.register(InstrumentName)
admin.site.register(Language)
admin.site.register(AVResource)


@admin.register(InstrumentName)
class InstrumentNameAdmin(admin.ModelAdmin):
list_filter = ("verification_status", "on_wikidata") # Filter by status
search_fields = (
"name",
"source_name",
"instrument__wikidata_id",
) # Search by name, source name, and instrument wikidata ID

def get_readonly_fields(self, request, obj=None):
"""
Make all fields except 'verification_status' read-only for users in the 'reviewer' group.
"""
if request.user.groups.filter(name="reviewer").exists():
return (
"instrument",
"language",
"name",
"source_name",
"umil_label",
"contributor",
"on_wikidata",
)
return super().get_readonly_fields(request, obj)
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import os
from typing import Optional
import requests
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand
from django.db import transaction
from VIM.apps.instruments.models import Instrument, InstrumentName, Language, AVResource
Expand All @@ -23,6 +25,12 @@ class Command(BaseCommand):
def __init__(self):
super().__init__()
self.language_map: dict[str, Language] = {}
User = get_user_model()
self.default_contributor = User.objects.get(username=settings.DDMAL_USERNAME)
if not self.default_contributor:
raise ValueError(
f"Default contributor {settings.DDMAL_USERNAME} not found in the database."
)

def parse_instrument_data(
self, instrument_id: str, instrument_data: dict
Expand All @@ -48,6 +56,11 @@ def parse_instrument_data(
ins_names: dict[str, str] = {
value["language"]: value["value"] for key, value in ins_labels.items()
}
ins_aliases: dict = instrument_data["aliases"]
ins_aliases_dict: dict[str, list[str]] = {
key: [alias["value"] for alias in value]
for key, value in ins_aliases.items()
}
# Get Hornbostel-Sachs and MIMO classifications, if available
ins_hbs: Optional[list[dict]] = instrument_data["claims"].get("P1762")
ins_mimo: Optional[list[dict]] = instrument_data["claims"].get("P3763")
Expand All @@ -64,6 +77,7 @@ def parse_instrument_data(
"ins_names": ins_names,
"hornbostel_sachs_class": hbs_class,
"mimo_class": mimo_class,
"ins_aliases": ins_aliases_dict,
}
return parsed_data

Expand All @@ -80,7 +94,7 @@ def get_instrument_data(self, instrument_ids: list[str]) -> list[dict]:
ins_ids_str: str = "|".join(instrument_ids)
url = (
"https://www.wikidata.org/w/api.php?action=wbgetentities&"
f"ids={ins_ids_str}&format=json&props=labels|descriptions|claims"
f"ids={ins_ids_str}&format=json&props=labels|descriptions|claims|aliases"
)
response = requests.get(url, timeout=10)
response_entities = response.json()["entities"]
Expand All @@ -103,7 +117,10 @@ def create_database_objects(
thumbnail_img_path [str]: Path to the thumbnail of the instrument image
"""
ins_names = instrument_attrs.pop("ins_names")
ins_aliases = instrument_attrs.pop("ins_aliases")
instrument, _ = Instrument.objects.update_or_create(**instrument_attrs)

# Create or update instrument labels in the database (umil_label=True)
for lang, name in ins_names.items():
# Skip if the language code is not found in the database.
# This commonly happens for codes like "mul" (multiple languages),
Expand All @@ -121,7 +138,34 @@ def create_database_objects(
language=self.language_map[lang],
name=name,
source_name="Wikidata",
umil_label=True,
contributor=self.default_contributor,
verification_status="verified",
on_wikidata=True,
)

# Create or update instrument aliases in the database (umil_label=False)
for lang, aliases in ins_aliases.items():
# Skip if the language code is not found in the database.
if lang not in self.language_map:
self.stdout.write(
self.style.WARNING(
f"Skipping language {lang} for instrument {instrument.wikidata_id} as the language is not found in the database."
)
)
continue
for alias in aliases:
InstrumentName.objects.update_or_create(
instrument=instrument,
language=self.language_map[lang],
name=alias,
source_name="Wikidata",
umil_label=False,
contributor=self.default_contributor,
verification_status="verified",
on_wikidata=True,
)

img_obj = AVResource.objects.create(
instrument=instrument,
type="image",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("instruments", "0002_instrument_thumbnail"),
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Generated by Django 4.2.5 on 2025-05-30 15:29

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("instruments", "0005_remove_language_wikidata_id"),
]

operations = [
migrations.AddField(
model_name="instrumentname",
name="contributor",
field=models.ForeignKey(
blank=True,
help_text="User who contributed this name",
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to=settings.AUTH_USER_MODEL,
),
),
migrations.AddField(
model_name="instrumentname",
name="is_alias",
field=models.BooleanField(
default=False,
help_text="Is this an alias for the instrument? If true, it will not be used as the main name.",
),
),
migrations.AddField(
model_name="instrumentname",
name="status",
field=models.CharField(
choices=[
("verified", "Verified"),
("unverified", "Unverified"),
("uploaded", "Uploaded"),
],
default="unverified",
help_text="Status of the name entry",
max_length=20,
),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Generated by Django 4.2.5 on 2025-06-16 13:54

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
(
"instruments",
"0006_instrumentname_contributor_instrumentname_is_alias_and_more",
),
]

operations = [
migrations.AddField(
model_name="instrumentname",
name="is_approved",
field=models.BooleanField(
default=False,
help_text="When a name is approved to be visible on UMIL and uploaded to Wikidata.",
),
),
migrations.AddField(
model_name="instrumentname",
name="on_wikidata",
field=models.BooleanField(
default=False, help_text="Is this name already on Wikidata?"
),
),
migrations.AlterField(
model_name="instrumentname",
name="status",
field=models.CharField(
choices=[
("verified", "Verified"),
("unverified", "Unverified"),
("needs_review", "Needs Review"),
("rejected", "Rejected"),
],
default="unverified",
help_text="Status of the name entry",
max_length=20,
),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Generated by Django 4.2.5 on 2025-08-07 17:10

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("instruments", "0007_instrumentname_is_approved_and_more"),
]

operations = [
migrations.RenameField(
model_name="instrumentname",
old_name="status",
new_name="verification_status",
),
migrations.RemoveField(
model_name="instrumentname",
name="is_alias",
),
migrations.RemoveField(
model_name="instrumentname",
name="is_approved",
),
migrations.AddField(
model_name="instrumentname",
name="umil_label",
field=models.BooleanField(
default=False,
help_text="Is this the label for the instrument? If true, it will be used as the main name.",
),
),
migrations.AlterField(
model_name="instrumentname",
name="contributor",
field=models.ForeignKey(
help_text="User who contributed this name",
null=True,
on_delete=django.db.models.deletion.PROTECT,
to=settings.AUTH_USER_MODEL,
),
),
migrations.AddConstraint(
model_name="instrumentname",
constraint=models.UniqueConstraint(
condition=models.Q(("umil_label", True)),
fields=("instrument", "language"),
name="unique_umil_label_per_instrument_language",
),
),
]
Loading