Skip to content

Commit

Permalink
feat: Make creating translation fields dynamic #1270
Browse files Browse the repository at this point in the history
  • Loading branch information
vanlummelhuizen committed Sep 19, 2024
1 parent 103da9c commit 18a97e2
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 2,778 deletions.
11 changes: 9 additions & 2 deletions INSTALL.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
bin/develop.py migrate
bin/develop.py createsuperuser

echo 'from django.contrib.contenttypes.models import ContentType; ContentType.objects.all().delete()' | bin/develop.py shell
echo 'from signbank.dictionary.models import FieldChoice; FieldChoice.objects.all().delete()' | bin/develop.py shell
Expand All @@ -16,5 +15,13 @@ bin/develop.py loaddata fixtures/handshapes.json
bin/develop.py loaddata fixtures/semanticfields.json
bin/develop.py loaddata fixtures/derivationhistories.json

# Copy values from default fields to translated fields
echo 'from signbank.dictionary.models import Language; print("\n".join(Language.objects.values_list("language_code_2char", flat=True)))' \
| bin/develop.py shell | xargs -i bin/develop.py update_translation_fields --language={}

echo
echo Creat a superuser:
bin/develop.py createsuperuser

echo
echo "IMPORTANT: Add yourself to Dataset_Manager group in admin"
echo "IMPORTANT: Add this superuser to Dataset_Manager group in admin"
24 changes: 0 additions & 24 deletions fixtures/derivationhistories.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
"pk": 0,
"fields": {
"name": "-",
"name_en": "-",
"name_nl": "-",
"name_zh_hans": "-",
"field_color": "ffffff",
"description": null
}
Expand All @@ -16,9 +13,6 @@
"pk": 1,
"fields": {
"name": "N/A",
"name_en": "N/A",
"name_nl": "N/A",
"name_zh_hans": "N/A",
"field_color": "ffffff",
"description": null
}
Expand All @@ -28,9 +22,6 @@
"pk": 4,
"fields": {
"name": "Arc",
"name_en": "Arc",
"name_nl": "Arc",
"name_zh_hans": "Arc",
"field_color": "ffffff",
"description": null
}
Expand All @@ -40,9 +31,6 @@
"pk": 6,
"fields": {
"name": "Straight",
"name_en": "Straight",
"name_nl": "Straight",
"name_zh_hans": "Straight",
"field_color": "ffffff",
"description": null
}
Expand All @@ -52,9 +40,6 @@
"pk": 12,
"fields": {
"name": "Zigzag",
"name_en": "Zigzag",
"name_nl": "Zigzag",
"name_zh_hans": "Zigzag",
"field_color": "ffffff",
"description": null
}
Expand All @@ -64,9 +49,6 @@
"pk": 37,
"fields": {
"name": "Circle",
"name_en": "Circle",
"name_nl": "Circle",
"name_zh_hans": "Circle",
"field_color": "ffffff",
"description": null
}
Expand All @@ -76,9 +58,6 @@
"pk": 44,
"fields": {
"name": "Motivated shape",
"name_en": "Motivated shape",
"name_nl": "Motivated shape",
"name_zh_hans": "Motivated shape",
"field_color": "ffffff",
"description": null
}
Expand All @@ -88,9 +67,6 @@
"pk": 45,
"fields": {
"name": "Spiral",
"name_en": "Spiral",
"name_nl": "Spiral",
"name_zh_hans": "Spiral",
"field_color": "ffffff",
"description": null
}
Expand Down
Loading

0 comments on commit 18a97e2

Please sign in to comment.