UI: Improve multi OS display #205
28
extensions/migrations/0042_platform_name.py
Normal file
28
extensions/migrations/0042_platform_name.py
Normal file
@ -0,0 +1,28 @@
|
||||
# Generated by Django 4.2.11 on 2024-05-14 11:06
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
def update_platforms(apps, schema_editor):
|
||||
lookup = {
|
||||
"windows-x64": "Windows",
|
||||
"windows-arm64": "Windows Arm",
|
||||
"macos-x64": "macOS Intel",
|
||||
"macos-arm64": "macOS Apple Silicon",
|
||||
"linux-x64": "Linux",
|
||||
}
|
||||
Platform = apps.get_model('extensions', 'Platform')
|
||||
for ob in Platform.objects.all():
|
||||
ob.name = lookup.get(ob.slug, ob.name)
|
||||
ob.save()
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('extensions', '0041_remove_version_file'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(update_platforms),
|
||||
]
|
Loading…
Reference in New Issue
Block a user