Skip to content

Commit

Permalink
fix(Django): fix babel currency list order (#447)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn authored Sep 14, 2024
1 parent 907beb9 commit 4da6da2
Show file tree
Hide file tree
Showing 3 changed files with 657 additions and 1 deletion.
2 changes: 1 addition & 1 deletion open_prices/common/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from babel.numbers import list_currencies

CURRENCY_LIST = [currency.upper() for currency in list_currencies()]
CURRENCY_LIST = sorted(list_currencies())
CURRENCY_CHOICES = [(key, key) for key in CURRENCY_LIST]
328 changes: 328 additions & 0 deletions open_prices/prices/migrations/0002_alter_price_currency.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,328 @@
# Generated by Django 5.1 on 2024-09-14 21:37

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("prices", "0001_initial"),
]

operations = [
migrations.AlterField(
model_name="price",
name="currency",
field=models.CharField(
blank=True,
choices=[
("ADP", "ADP"),
("AED", "AED"),
("AFA", "AFA"),
("AFN", "AFN"),
("ALK", "ALK"),
("ALL", "ALL"),
("AMD", "AMD"),
("ANG", "ANG"),
("AOA", "AOA"),
("AOK", "AOK"),
("AON", "AON"),
("AOR", "AOR"),
("ARA", "ARA"),
("ARL", "ARL"),
("ARM", "ARM"),
("ARP", "ARP"),
("ARS", "ARS"),
("ATS", "ATS"),
("AUD", "AUD"),
("AWG", "AWG"),
("AZM", "AZM"),
("AZN", "AZN"),
("BAD", "BAD"),
("BAM", "BAM"),
("BAN", "BAN"),
("BBD", "BBD"),
("BDT", "BDT"),
("BEC", "BEC"),
("BEF", "BEF"),
("BEL", "BEL"),
("BGL", "BGL"),
("BGM", "BGM"),
("BGN", "BGN"),
("BGO", "BGO"),
("BHD", "BHD"),
("BIF", "BIF"),
("BMD", "BMD"),
("BND", "BND"),
("BOB", "BOB"),
("BOL", "BOL"),
("BOP", "BOP"),
("BOV", "BOV"),
("BRB", "BRB"),
("BRC", "BRC"),
("BRE", "BRE"),
("BRL", "BRL"),
("BRN", "BRN"),
("BRR", "BRR"),
("BRZ", "BRZ"),
("BSD", "BSD"),
("BTN", "BTN"),
("BUK", "BUK"),
("BWP", "BWP"),
("BYB", "BYB"),
("BYN", "BYN"),
("BYR", "BYR"),
("BZD", "BZD"),
("CAD", "CAD"),
("CDF", "CDF"),
("CHE", "CHE"),
("CHF", "CHF"),
("CHW", "CHW"),
("CLE", "CLE"),
("CLF", "CLF"),
("CLP", "CLP"),
("CNH", "CNH"),
("CNX", "CNX"),
("CNY", "CNY"),
("COP", "COP"),
("COU", "COU"),
("CRC", "CRC"),
("CSD", "CSD"),
("CSK", "CSK"),
("CUC", "CUC"),
("CUP", "CUP"),
("CVE", "CVE"),
("CYP", "CYP"),
("CZK", "CZK"),
("DDM", "DDM"),
("DEM", "DEM"),
("DJF", "DJF"),
("DKK", "DKK"),
("DOP", "DOP"),
("DZD", "DZD"),
("ECS", "ECS"),
("ECV", "ECV"),
("EEK", "EEK"),
("EGP", "EGP"),
("ERN", "ERN"),
("ESA", "ESA"),
("ESB", "ESB"),
("ESP", "ESP"),
("ETB", "ETB"),
("EUR", "EUR"),
("FIM", "FIM"),
("FJD", "FJD"),
("FKP", "FKP"),
("FRF", "FRF"),
("GBP", "GBP"),
("GEK", "GEK"),
("GEL", "GEL"),
("GHC", "GHC"),
("GHS", "GHS"),
("GIP", "GIP"),
("GMD", "GMD"),
("GNF", "GNF"),
("GNS", "GNS"),
("GQE", "GQE"),
("GRD", "GRD"),
("GTQ", "GTQ"),
("GWE", "GWE"),
("GWP", "GWP"),
("GYD", "GYD"),
("HKD", "HKD"),
("HNL", "HNL"),
("HRD", "HRD"),
("HRK", "HRK"),
("HTG", "HTG"),
("HUF", "HUF"),
("IDR", "IDR"),
("IEP", "IEP"),
("ILP", "ILP"),
("ILR", "ILR"),
("ILS", "ILS"),
("INR", "INR"),
("IQD", "IQD"),
("IRR", "IRR"),
("ISJ", "ISJ"),
("ISK", "ISK"),
("ITL", "ITL"),
("JMD", "JMD"),
("JOD", "JOD"),
("JPY", "JPY"),
("KES", "KES"),
("KGS", "KGS"),
("KHR", "KHR"),
("KMF", "KMF"),
("KPW", "KPW"),
("KRH", "KRH"),
("KRO", "KRO"),
("KRW", "KRW"),
("KWD", "KWD"),
("KYD", "KYD"),
("KZT", "KZT"),
("LAK", "LAK"),
("LBP", "LBP"),
("LKR", "LKR"),
("LRD", "LRD"),
("LSL", "LSL"),
("LTL", "LTL"),
("LTT", "LTT"),
("LUC", "LUC"),
("LUF", "LUF"),
("LUL", "LUL"),
("LVL", "LVL"),
("LVR", "LVR"),
("LYD", "LYD"),
("MAD", "MAD"),
("MAF", "MAF"),
("MCF", "MCF"),
("MDC", "MDC"),
("MDL", "MDL"),
("MGA", "MGA"),
("MGF", "MGF"),
("MKD", "MKD"),
("MKN", "MKN"),
("MLF", "MLF"),
("MMK", "MMK"),
("MNT", "MNT"),
("MOP", "MOP"),
("MRO", "MRO"),
("MRU", "MRU"),
("MTL", "MTL"),
("MTP", "MTP"),
("MUR", "MUR"),
("MVP", "MVP"),
("MVR", "MVR"),
("MWK", "MWK"),
("MXN", "MXN"),
("MXP", "MXP"),
("MXV", "MXV"),
("MYR", "MYR"),
("MZE", "MZE"),
("MZM", "MZM"),
("MZN", "MZN"),
("NAD", "NAD"),
("NGN", "NGN"),
("NIC", "NIC"),
("NIO", "NIO"),
("NLG", "NLG"),
("NOK", "NOK"),
("NPR", "NPR"),
("NZD", "NZD"),
("OMR", "OMR"),
("PAB", "PAB"),
("PEI", "PEI"),
("PEN", "PEN"),
("PES", "PES"),
("PGK", "PGK"),
("PHP", "PHP"),
("PKR", "PKR"),
("PLN", "PLN"),
("PLZ", "PLZ"),
("PTE", "PTE"),
("PYG", "PYG"),
("QAR", "QAR"),
("RHD", "RHD"),
("ROL", "ROL"),
("RON", "RON"),
("RSD", "RSD"),
("RUB", "RUB"),
("RUR", "RUR"),
("RWF", "RWF"),
("SAR", "SAR"),
("SBD", "SBD"),
("SCR", "SCR"),
("SDD", "SDD"),
("SDG", "SDG"),
("SDP", "SDP"),
("SEK", "SEK"),
("SGD", "SGD"),
("SHP", "SHP"),
("SIT", "SIT"),
("SKK", "SKK"),
("SLE", "SLE"),
("SLL", "SLL"),
("SOS", "SOS"),
("SRD", "SRD"),
("SRG", "SRG"),
("SSP", "SSP"),
("STD", "STD"),
("STN", "STN"),
("SUR", "SUR"),
("SVC", "SVC"),
("SYP", "SYP"),
("SZL", "SZL"),
("THB", "THB"),
("TJR", "TJR"),
("TJS", "TJS"),
("TMM", "TMM"),
("TMT", "TMT"),
("TND", "TND"),
("TOP", "TOP"),
("TPE", "TPE"),
("TRL", "TRL"),
("TRY", "TRY"),
("TTD", "TTD"),
("TWD", "TWD"),
("TZS", "TZS"),
("UAH", "UAH"),
("UAK", "UAK"),
("UGS", "UGS"),
("UGX", "UGX"),
("USD", "USD"),
("USN", "USN"),
("USS", "USS"),
("UYI", "UYI"),
("UYP", "UYP"),
("UYU", "UYU"),
("UYW", "UYW"),
("UZS", "UZS"),
("VEB", "VEB"),
("VED", "VED"),
("VEF", "VEF"),
("VES", "VES"),
("VND", "VND"),
("VNN", "VNN"),
("VUV", "VUV"),
("WST", "WST"),
("XAF", "XAF"),
("XAG", "XAG"),
("XAU", "XAU"),
("XBA", "XBA"),
("XBB", "XBB"),
("XBC", "XBC"),
("XBD", "XBD"),
("XCD", "XCD"),
("XDR", "XDR"),
("XEU", "XEU"),
("XFO", "XFO"),
("XFU", "XFU"),
("XOF", "XOF"),
("XPD", "XPD"),
("XPF", "XPF"),
("XPT", "XPT"),
("XRE", "XRE"),
("XSU", "XSU"),
("XTS", "XTS"),
("XUA", "XUA"),
("XXX", "XXX"),
("YDD", "YDD"),
("YER", "YER"),
("YUD", "YUD"),
("YUM", "YUM"),
("YUN", "YUN"),
("YUR", "YUR"),
("ZAL", "ZAL"),
("ZAR", "ZAR"),
("ZMK", "ZMK"),
("ZMW", "ZMW"),
("ZRN", "ZRN"),
("ZRZ", "ZRZ"),
("ZWD", "ZWD"),
("ZWL", "ZWL"),
("ZWR", "ZWR"),
],
max_length=3,
null=True,
),
),
]
Loading

0 comments on commit 4da6da2

Please sign in to comment.