From 66732272bf641c3d621a6b837e96b8d6a361ff53 Mon Sep 17 00:00:00 2001 From: maltaesousa Date: Tue, 23 Jan 2024 16:03:42 +0100 Subject: [PATCH] delete back folder --- back/.dockerignore => .dockerignore | 22 +- back/.env.sample => .env.sample | 35 +- .gitignore | 111 +- back/.pylintrc => .pylintrc | 0 CONTRIBUTING.md | 12 - back/Dockerfile => Dockerfile | 0 .../fr/LC_MESSAGES => LC_MESSAGES}/django.po | 0 README.md | 219 +- {back/api => api}/__init__.py | 0 {back/api => api}/admin.py | 14 +- {back/api => api}/apps.py | 16 +- {back/api => api}/filters.py | 0 {back/api => api}/helpers.py | 0 .../locale/fr/LC_MESSAGES/django.po | 0 .../management/commands/fixturize.py | 2 +- .../management/commands/prepareusertests.py | 0 {back/api => api}/migrations/0001_initial.py | 0 .../migrations/0002_auto_20200731_0904.py | 48 +- .../migrations/0003_auto_20200731_1203.py | 66 +- .../migrations/0004_auto_20200731_1339.py | 64 +- .../migrations/0005_auto_20200803_1706.py | 68 +- .../migrations/0006_auto_20200805_0843.py | 106 +- .../migrations/0007_auto_20200805_1138.py | 38 +- .../0008_orderitem_extract_result.py | 36 +- .../migrations/0009_auto_20200811_1645.py | 38 +- .../migrations/0010_auto_20200814_1212.py | 74 +- .../migrations/0011_auto_20200814_1559.py | 46 +- .../migrations/0012_auto_20201005_1620.py | 38 +- .../migrations/0013_auto_20201009_1513.py | 38 +- .../migrations/0014_auto_20201014_1549.py | 34 +- .../0015_product_free_when_subscribed.py | 36 +- .../migrations/0016_contact_subscribed.py | 52 +- .../migrations/0017_auto_20201209_0807.py | 48 +- .../migrations/0018_orderitem_status.py | 36 +- .../migrations/0019_auto_20201218_0902.py | 46 +- .../migrations/0020_auto_20210108_1749.py | 36 +- .../migrations/0021_auto_20210115_1547.py | 0 .../migrations/0022_auto_20210129_1804.py | 0 .../migrations/0023_auto_20210224_1542.py | 0 .../migrations/0024_auto_20210226_0950.py | 0 .../migrations/0025_metadata_datasource.py | 0 .../migrations/0026_auto_20210409_1428.py | 0 .../migrations/0027_order_email_deliver.py | 0 .../migrations/0028_auto_20210510_1528.py | 0 .../migrations/0029_auto_20210604_1417.py | 2 +- .../migrations/0030_auto_20210707_1357.py | 0 .../migrations/0031_product_geom.py | 0 .../migrations/0032_auto_20211221_1223.py | 0 .../migrations/0033_auto_20211221_1431.py | 0 .../migrations/0034_alter_product_label.py | 0 .../migrations/0035_auto_20220103_1630.py | 0 .../0036_orderitem_validation_date.py | 0 .../migrations/0037_alter_product_metadata.py | 0 .../0038_metadatacontact_is_validator.py | 0 .../migrations/0039_alter_product_geom.py | 0 .../migrations/0040_alter_product_provider.py | 0 .../0041_alter_metadata_accessibility.py | 0 .../migrations/0042_auto_20220727_1327.py | 0 .../migrations/0043_auto_20220727_1337.py | 0 ...oportal_link_metadata_wms_link_and_more.py | 0 ...metadata_data_last_update_date_and_more.py | 0 .../migrations/0046_alter_metadata_options.py | 0 .../0047_alter_document_link_and_more.py | 3561 +++++++++++++++++ {back/api => api}/migrations/__init__.py | 0 api/models.py | 1064 +++++ {back/api => api}/permissions.py | 0 {back/api => api}/pricing.py | 0 {back/api => api}/routers.py | 0 {back/api => api}/serializers.py | 0 {back/api => api}/signals.py | 0 {back/api => api}/static/api/admin-extra.css | 4 +- .../static/api/default_metadata_image.png | Bin .../static/api/default_product_thumbnail.png | Bin {back/api => api}/static/api/favicon.ico | Bin .../admin/api/order_change_form.html | 0 .../templates/admin/api/user_change_form.html | 0 .../templates/email_admin_fr-ch.html | 0 .../templates/email_base_template.html | 0 .../templates/email_download_ready_fr-ch.html | 0 .../templates/email_password_reset.html | 0 .../templates/email_quote_done_fr-ch.html | 0 .../templates/email_user_change_fr-ch.html | 0 .../templates/email_user_confirm_fr-ch.html | 0 .../email_validation_needed_fr-ch.html | 0 .../templates/email_welcome_user_fr-ch.html | 0 api/templates/gis/admin/custom.html | 2 + {back/api => api}/templates/metadata.html | 0 .../templates/metadata_simple.html | 0 .../templates/rest_framework/api.html | 42 +- {back/api => api}/tests/__init__.py | 0 {back/api => api}/tests/factories.py | 4 +- {back/api => api}/tests/test_auth.py | 0 {back/api => api}/tests/test_extract.py | 2 +- {back/api => api}/tests/test_identity.py | 0 {back/api => api}/tests/test_metadata.py | 0 {back/api => api}/tests/test_order.py | 0 {back/api => api}/tests/test_pricing.py | 0 {back/api => api}/tests/test_product_group.py | 0 {back/api => api}/tests/test_user.py | 0 {back/api => api}/tests/test_user_contact.py | 0 {back/api => api}/tests/test_zip.py | 0 {back/api => api}/views.py | 12 - back/.gitignore | 96 - back/Pipfile | 25 - back/Pipfile.lock | 669 ---- back/api/models.py | 844 ---- back/api/templates/gis/admin/sitn.html | 2 - back/api/templates/gis/admin/sitn.js | 21 - back/asgi.py | 16 - back/settings.py => default_settings.py | 15 +- {back/static => files}/.gitkeep | 0 back/manage.py => manage.py | 42 +- back/requirements.txt => requirements.txt | 0 static/.gitkeep | 0 back/urls.py => urls.py | 0 back/wsgi.py => wsgi.py | 42 +- 116 files changed, 5354 insertions(+), 2490 deletions(-) rename back/.dockerignore => .dockerignore (89%) rename back/.env.sample => .env.sample (58%) rename back/.pylintrc => .pylintrc (100%) delete mode 100644 CONTRIBUTING.md rename back/Dockerfile => Dockerfile (100%) rename {back/conf/locale/fr/LC_MESSAGES => LC_MESSAGES}/django.po (100%) rename {back/api => api}/__init__.py (100%) rename {back/api => api}/admin.py (96%) rename {back/api => api}/apps.py (94%) rename {back/api => api}/filters.py (100%) rename {back/api => api}/helpers.py (100%) rename {back/api => api}/locale/fr/LC_MESSAGES/django.po (100%) rename {back/api => api}/management/commands/fixturize.py (93%) rename {back/api => api}/management/commands/prepareusertests.py (100%) rename {back/api => api}/migrations/0001_initial.py (100%) rename {back/api => api}/migrations/0002_auto_20200731_0904.py (96%) rename {back/api => api}/migrations/0003_auto_20200731_1203.py (97%) rename {back/api => api}/migrations/0004_auto_20200731_1339.py (96%) rename {back/api => api}/migrations/0005_auto_20200803_1706.py (97%) rename {back/api => api}/migrations/0006_auto_20200805_0843.py (97%) rename {back/api => api}/migrations/0007_auto_20200805_1138.py (96%) rename {back/api => api}/migrations/0008_orderitem_extract_result.py (95%) rename {back/api => api}/migrations/0009_auto_20200811_1645.py (96%) rename {back/api => api}/migrations/0010_auto_20200814_1212.py (97%) rename {back/api => api}/migrations/0011_auto_20200814_1559.py (96%) rename {back/api => api}/migrations/0012_auto_20201005_1620.py (96%) rename {back/api => api}/migrations/0013_auto_20201009_1513.py (96%) rename {back/api => api}/migrations/0014_auto_20201014_1549.py (95%) rename {back/api => api}/migrations/0015_product_free_when_subscribed.py (96%) rename {back/api => api}/migrations/0016_contact_subscribed.py (96%) rename {back/api => api}/migrations/0017_auto_20201209_0807.py (97%) rename {back/api => api}/migrations/0018_orderitem_status.py (96%) rename {back/api => api}/migrations/0019_auto_20201218_0902.py (97%) rename {back/api => api}/migrations/0020_auto_20210108_1749.py (96%) rename {back/api => api}/migrations/0021_auto_20210115_1547.py (100%) rename {back/api => api}/migrations/0022_auto_20210129_1804.py (100%) rename {back/api => api}/migrations/0023_auto_20210224_1542.py (100%) rename {back/api => api}/migrations/0024_auto_20210226_0950.py (100%) rename {back/api => api}/migrations/0025_metadata_datasource.py (100%) rename {back/api => api}/migrations/0026_auto_20210409_1428.py (100%) rename {back/api => api}/migrations/0027_order_email_deliver.py (100%) rename {back/api => api}/migrations/0028_auto_20210510_1528.py (100%) rename {back/api => api}/migrations/0029_auto_20210604_1417.py (95%) rename {back/api => api}/migrations/0030_auto_20210707_1357.py (100%) rename {back/api => api}/migrations/0031_product_geom.py (100%) rename {back/api => api}/migrations/0032_auto_20211221_1223.py (100%) rename {back/api => api}/migrations/0033_auto_20211221_1431.py (100%) rename {back/api => api}/migrations/0034_alter_product_label.py (100%) rename {back/api => api}/migrations/0035_auto_20220103_1630.py (100%) rename {back/api => api}/migrations/0036_orderitem_validation_date.py (100%) rename {back/api => api}/migrations/0037_alter_product_metadata.py (100%) rename {back/api => api}/migrations/0038_metadatacontact_is_validator.py (100%) rename {back/api => api}/migrations/0039_alter_product_geom.py (100%) rename {back/api => api}/migrations/0040_alter_product_provider.py (100%) rename {back/api => api}/migrations/0041_alter_metadata_accessibility.py (100%) rename {back/api => api}/migrations/0042_auto_20220727_1327.py (100%) rename {back/api => api}/migrations/0043_auto_20220727_1337.py (100%) rename {back/api => api}/migrations/0044_metadata_geoportal_link_metadata_wms_link_and_more.py (100%) rename {back/api => api}/migrations/0045_alter_metadata_data_last_update_date_and_more.py (100%) rename {back/api => api}/migrations/0046_alter_metadata_options.py (100%) create mode 100644 api/migrations/0047_alter_document_link_and_more.py rename {back/api => api}/migrations/__init__.py (100%) create mode 100644 api/models.py rename {back/api => api}/permissions.py (100%) rename {back/api => api}/pricing.py (100%) rename {back/api => api}/routers.py (100%) rename {back/api => api}/serializers.py (100%) rename {back/api => api}/signals.py (100%) rename {back/api => api}/static/api/admin-extra.css (94%) rename {back/api => api}/static/api/default_metadata_image.png (100%) rename {back/api => api}/static/api/default_product_thumbnail.png (100%) rename {back/api => api}/static/api/favicon.ico (100%) rename {back/api => api}/templates/admin/api/order_change_form.html (100%) rename {back/api => api}/templates/admin/api/user_change_form.html (100%) rename {back/api => api}/templates/email_admin_fr-ch.html (100%) rename {back/api => api}/templates/email_base_template.html (100%) rename {back/api => api}/templates/email_download_ready_fr-ch.html (100%) rename {back/api => api}/templates/email_password_reset.html (100%) rename {back/api => api}/templates/email_quote_done_fr-ch.html (100%) rename {back/api => api}/templates/email_user_change_fr-ch.html (100%) rename {back/api => api}/templates/email_user_confirm_fr-ch.html (100%) rename {back/api => api}/templates/email_validation_needed_fr-ch.html (100%) rename {back/api => api}/templates/email_welcome_user_fr-ch.html (100%) create mode 100644 api/templates/gis/admin/custom.html rename {back/api => api}/templates/metadata.html (100%) rename {back/api => api}/templates/metadata_simple.html (100%) rename {back/api => api}/templates/rest_framework/api.html (95%) rename {back/api => api}/tests/__init__.py (100%) rename {back/api => api}/tests/factories.py (98%) rename {back/api => api}/tests/test_auth.py (100%) rename {back/api => api}/tests/test_extract.py (98%) rename {back/api => api}/tests/test_identity.py (100%) rename {back/api => api}/tests/test_metadata.py (100%) rename {back/api => api}/tests/test_order.py (100%) rename {back/api => api}/tests/test_pricing.py (100%) rename {back/api => api}/tests/test_product_group.py (100%) rename {back/api => api}/tests/test_user.py (100%) rename {back/api => api}/tests/test_user_contact.py (100%) rename {back/api => api}/tests/test_zip.py (100%) rename {back/api => api}/views.py (99%) delete mode 100644 back/.gitignore delete mode 100644 back/Pipfile delete mode 100644 back/Pipfile.lock delete mode 100644 back/api/models.py delete mode 100644 back/api/templates/gis/admin/sitn.html delete mode 100644 back/api/templates/gis/admin/sitn.js delete mode 100644 back/asgi.py rename back/settings.py => default_settings.py (95%) rename {back/static => files}/.gitkeep (100%) rename back/manage.py => manage.py (96%) rename back/requirements.txt => requirements.txt (100%) create mode 100644 static/.gitkeep rename back/urls.py => urls.py (100%) rename back/wsgi.py => wsgi.py (96%) diff --git a/back/.dockerignore b/.dockerignore similarity index 89% rename from back/.dockerignore rename to .dockerignore index df77a161..f28d8df8 100644 --- a/back/.dockerignore +++ b/.dockerignore @@ -1,11 +1,11 @@ -*.pyc -*.pyo -*.mo -*.db -*.css.map -*.egg-info -.cache -__pycache__.venv -Dockerfile -./files/* -.env +*.pyc +*.pyo +*.mo +*.db +*.css.map +*.egg-info +.cache +__pycache__.venv +Dockerfile +./files/* +.env diff --git a/back/.env.sample b/.env.sample similarity index 58% rename from back/.env.sample rename to .env.sample index 7ec2e695..0d634430 100644 --- a/back/.env.sample +++ b/.env.sample @@ -1,3 +1,6 @@ +# Do not set this to True if your server is exposed to internet! +DEBUG=False + PGDATABASE=geoshop PGUSER=geoshop PGHOST=host.docker.internal @@ -5,39 +8,39 @@ PGPORT=5432 PGPASSWORD=geoshop PGSCHEMA=geoshop -MEDIA_ROOT=/mnt/geoshop_data -MEDIA_URL=https://sitn.ne.ch/geoshop2_media/ - -# DOCKER_HOST=ssh://user@server.example.com -DOCKER_BACK_PORT=5004 -DOCKER_FRONT_PORT=5005 -DOCKER_BASE=sitn/geoshop-dev -COMPOSE_PROJECT_NAME=geoshop-dev +# The folder where the geodata will be uploaded +MEDIA_ROOT=./files +# A link to public images used in product and metadata +MEDIA_URL=https://example.com/geoshop_media/ -ROOTURL=/geoshop2_api ALLOWED_HOST=localhost,127.0.0.1,proxy.example.com +# Base URL of the api +ROOTURL= + DEFAULT_FROM_EMAIL=no-reply@ne.ch -ADMIN_EMAIL_LIST=sitn@ne.ch EMAIL_HOST=smtp.example.com +ADMIN_EMAIL_LIST=admin@example.com + +# This is used for CORS and to generate links in email templates FRONT_URL=localhost:4200 FRONT_HREF=/geoshop FRONT_PROTOCOL=http CSRF_COOKIE_DOMAIN=localhost -LOGGING_LEVEL=DEBUG +LOGGING_LEVEL=INFO + # Generate this key with Django tools SECRET_KEY=GenerateOneSecretKey ADMIN_PASSWORD=Test1234 EXTRACT_USER_PASSWORD=Test1234 -API_BASE_URL=http://example.com AUTO_LEGEND_URL=http://example.com/mapserv?FORMAT=image%2Fpng&TRANSPARENT=true&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&LAYER= # If you plan to manage secret metadata, provide your intranet legend service INTRA_LEGEND_URL=https://example.com/mapserv_proxy?ogcserver=source+for+image%2Fpng&FORMAT=image%2Fpng&TRANSPARENT=true&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetLegendGraphic&LAYER= # Only for testing purpose EMAIL_TEST_TO=test@example.com -GEOSHOP_DATA=/path/to/geoshop_data/folder -# For non-docker, if you want GDAL in you venv -# GDAL_IN_VENV=True -# GDAL_DATA=path\to\.venv\Lib\site-packages\osgeo\data\gdal \ No newline at end of file +# For non-docker, uncomment this (only tested in Windows) +#GDAL_PATH="C:\Applications\Mapserver72_x64\bin" +#GDAL_LIBRARY_PATH="C:\Applications\Mapserver72_x64\bin\gdal300.dll" +#GEOS_LIBRARY_PATH="C:\Applications\Mapserver72_x64\bin\geos_c.dll" diff --git a/.gitignore b/.gitignore index dea29dbc..999a6226 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,104 @@ -.vscode -back/.idea/ -front/.idea/ -front/node_modules/ -apache/app.conf -back/files/* -logs/* -!logs/.gitkeep +# Created by https://www.gitignore.io + +### OSX ### +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.cache +nosetests.xml +coverage.xml + +# Translations +*.mo +*.pot + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + + +### Django ### +*.log +*.pot *.pyc +__pycache__/ +local_settings.py + +.env +.env.local +.env.dev +.env.prod +.env.prepub +db.sqlite3 +.venv +venv +settings.py + +# collected static files +static/* +!static/.gitkeep -front/debug.log +# local dev files +files/* +!files/.gitkeep diff --git a/back/.pylintrc b/.pylintrc similarity index 100% rename from back/.pylintrc rename to .pylintrc diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 33e673c8..00000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,12 +0,0 @@ -# Code - -* Python code should be linted (PEP8 standard) -* Maximum line length is 120 characters. - -Keep pull requests small. Pull requests should not be related to more than one issue. Link the issue in the pull request when submitting it. - -# Definition of done - -Issues are considered done all this criterias are met: -* The pull request related to the issue has been reviewed -* The backend code is tested diff --git a/back/Dockerfile b/Dockerfile similarity index 100% rename from back/Dockerfile rename to Dockerfile diff --git a/back/conf/locale/fr/LC_MESSAGES/django.po b/LC_MESSAGES/django.po similarity index 100% rename from back/conf/locale/fr/LC_MESSAGES/django.po rename to LC_MESSAGES/django.po diff --git a/README.md b/README.md index cedec13f..ed8cd7d0 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,24 @@ -# Geoshop +# Geoshop Backend ## Requirements * PostgreSQL >= 11 + PostGIS * Python >= 3.9 +* GDAL ## Getting started -Fork and clone this repository. Make a copy of the `.env` file and adapt it to your environment settings: +Fork and clone this repository. Make a copy of `default_settings.py` and `.env.sample` file and adapt it to your environment settings: ```powershell -cd back -cp .env.sample .env.local -cd .. +cp default_settings.py settings.py +cp .env.sample .env ``` -### Database +`.env` will vary depending on the environements you're targetting. +`settings.py` will get the specific config of your project. -The best is to backup and restore a production db. Otherwise, to start from scratch follow this. +### Database Create a `geoshop` user if not existing yet, set your password according to your `env.local`: @@ -25,20 +26,22 @@ Create a `geoshop` user if not existing yet, set your password according to your CREATE ROLE geoshop WITH LOGIN PASSWORD ; ``` -Then, set up a database in psql: +Then, set up a database: ```sql CREATE DATABASE geoshop OWNER geoshop; REVOKE ALL ON DATABASE geoshop FROM PUBLIC; ``` -Then connect to the geoshop database `\c geoshop` and create extensions: +Then connect to the geoshop database and create extensions: ```sql CREATE EXTENSION postgis; CREATE EXTENSION unaccent; CREATE EXTENSION "uuid-ossp"; CREATE SCHEMA geoshop AUTHORIZATION geoshop; + +-- TODO: Only if french is needed CREATE TEXT SEARCH CONFIGURATION fr (COPY = simple); ALTER TEXT SEARCH CONFIGURATION fr ALTER MAPPING FOR hword, hword_part, word WITH unaccent, simple; @@ -46,200 +49,36 @@ WITH unaccent, simple; Now that the database is ready, you can start backend either with Docker or not. -### Backend with docker - -To ease debug, you can add `DEBUG=True` to your `env.local` file. Never add this to a container exposed on internet. - -Build backend image: - -```powershell -cd back -docker build -t sitn/geoshop-dev-api --build-arg ENV_FILE=.env.local . -``` - -If you started with an empty database, run this once in order to create admin account: - -```powershell -docker run --rm --name geoshop --env-file=.env.local sitn/geoshop-dev-api python manage.py fixturize -``` - -Now you can run it with: - -```powershell -docker run -d --rm --name geoshop --env-file=.env.local -p 8000:8000 -v ${PWD}:/app/geoshop_back sitn/geoshop-dev-api gunicorn --reload wsgi -b :8000 -``` - -You should be able to visit the API at http://localhost:8000. - -Run tests: - -```powershell -docker run --rm --env-file=.env.local -v ${PWD}:/app/geoshop_back sitn/geoshop-dev-api python manage.py test api -``` - -Make messages for translation: - -```powershell -docker run --rm --env-file=.env.local -v ${PWD}:/app/geoshop_back:rw sitn/geoshop-dev-api python manage.py makemessages -l fr -``` - -Stop the server: -```powershell -docker stop geoshop -``` - -### Backend without docker on Windows - -> :warning: **No longer maintained**: Installing GDAL in windows is really painfull, use docker for backend. - -If not using docker, additionnal packages are required: - -* pipenv (pip install pipenv) -* GDAL 2.4 (see instructions below to install it in your venv) - -Install the app. If you want your `venv` to be inside your project directory, you need to set `PIPENV_VENV_IN_PROJECT` environment variable, otherwise it'll go to your profile, if you want `DEBUG` to be enabled, change it in `settings.py` file but never commit it with debug enabled: - -```powershell -cd back -$env:PIPENV_VENV_IN_PROJECT="True" -pipenv install --dev # installs everything needed -pipenv shell # activates venv and reads .env file -``` - -#### Installing GDAL on Windows, only once per machine -Download the GDAL 2.4 wheel (3.X isn't supported yet by Django) on this page: https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal. For example, if you have Python 3.6 64bit, choose `GDAL‑2.4.1‑cp36‑cp36m‑win_amd64.whl`. -Then install it weather system wide or in your venv (the example below will show the venv variant and expects you have your venv activated): - -```powershell -pip install path\to\your\GDAL-2.4XXXX.whl -``` - -You'll then need to add GDAL dll to your PATH if you installed it system wide. You can get the dll path with: +### Run dev server without docker on Windows -```python -python +You'll need to configure 3 paths to your GDAL installation according to `.env.sample`. -from pathlib import Path, PureWindowsPath -from osgeo import gdal - -print(PureWindowsPath(gdal.__file__).parent) -``` +Then, we're going to: -Otherwise, if you installed it in your venv, configure `.env` properly. + * Run migrations + * Collect static files for the admin interface + * Generate translations for your langage + * Add minimal users to database -### Migrate and run - -You should now be able to run migrations: - -```powershell +```shell python manage.py migrate -``` - -If you're starting with a fresh new database you'll need to create an user or restore a dump: - -```powershell -python manage.py createsuperuser --email admin@example.com --username admin -``` - -Your database should be ready, now you can run the backend: - -```powershell -python manage.py runserver -``` - -Translations can be generated, static files collected with: - -```powershell +python manage.py collectstatic python manage.py compilemessages --locale=fr -python .\manage.py collectstatic +python manage.py fixturize ``` -Then, set `DEBUG` to `True` in `back/settings.py` and you can finally run the server: +Finally, you can run the server: -```powershell +```shell python manage.py runserver ``` -> :warning: **DO NOT COMMIT settings.py with `DEBUG` set to `True` !** - -### Run tests - -```powershell -python manage.py test api -``` - -### Frontend +## Run tests -Install the current LTS version of [Nodejs](https://nodejs.org/en/). - -Install @angular/cli and typescript globally - -```powershell -npm install -g @angular/cli typescript -``` - -Install the dependances of the frontend - -```powershell -cd front -npm install +```shell +python manage.py test ``` -Edit the settings, the file is /front/copy-config.ps1 - -Typicall values for dev purposes are: - -```json - "apiUrl": "https://sitn.ne.ch/geoshop2_prepub_api", - "mediaUrl": "https://sitn.ne.ch/geoshop2_prepub_media/images", -``` - -To start the debug of the frontend - -```powershell -npm start -``` - -1. Will run the batch /front/copy-config.ps1 -2. Will automatically run chrome with insecure flags to allow CORS request -3. Chrome browser will be waiting with [Geoshop2](http://localhost:4200) - -## Deploy - -Create an `env.prod` file base on `env.sample`. - -### Application deployment - -```powershell -.\scripts\4_deploy_prod.ps1 -``` - -Create a scheduled task that runs `scripts/geoshop_clean_orders.ps1` every month. - -More info on bookstack - - -## Upgrading front-end packages - -Go to https://update.angular.io/?v=16.0-17.0 and check there are not manual steps to be done. - -Then follow instructions. After upgrading, some packages will need to be upgraded according to angular version -you will be using. For instance, if you'll upgrade to version 17, you need to target version 17 for these packages: - -```powershell -ng update @ngrx/store@17 angular-split@17 -``` - -After, you can update other packages: - -```powershell -ng update lodash-es rxjs tslib zone.js -``` - -Finally, update those related to OpenLayers: - -```powershell -ng update ol ol-ext ol-geocoder proj4 -``` +## Customize -Then all the front-end tests should be done. +custom.js in `api/templates/gis/admin` diff --git a/back/api/__init__.py b/api/__init__.py similarity index 100% rename from back/api/__init__.py rename to api/__init__.py diff --git a/back/api/admin.py b/api/admin.py similarity index 96% rename from back/api/admin.py rename to api/admin.py index 8ba25d94..af05892e 100644 --- a/back/api/admin.py +++ b/api/admin.py @@ -1,6 +1,8 @@ +from pathlib import Path +import os + from django import forms from django.conf import settings -from django.db import models from django.contrib import messages from django.contrib.auth.admin import UserAdmin as BaseUserAdmin from django.contrib.auth import get_user_model @@ -37,8 +39,14 @@ class Media: class CustomGeoModelAdmin(CustomModelAdmin): - map_template = 'gis/admin/sitn.html' - map_srid = 2056 + """ + Custom widget for the admin if a custom js is provided + TODO: deprecated in 5.0 + """ + current_dir = os.path.dirname(os.path.realpath(__file__)) + if Path(f'{current_dir}/templates/gis/admin/custom.js').is_file(): + map_template = 'gis/admin/custom.html' + map_srid = 2056 class DocumentAdmin(CustomModelAdmin): diff --git a/back/api/apps.py b/api/apps.py similarity index 94% rename from back/api/apps.py rename to api/apps.py index 33abd94e..c21e145d 100644 --- a/back/api/apps.py +++ b/api/apps.py @@ -1,8 +1,8 @@ -from django.apps import AppConfig - - -class ApiConfig(AppConfig): - name = 'api' - - def ready(self): - import api.signals +from django.apps import AppConfig + + +class ApiConfig(AppConfig): + name = 'api' + + def ready(self): + import api.signals diff --git a/back/api/filters.py b/api/filters.py similarity index 100% rename from back/api/filters.py rename to api/filters.py diff --git a/back/api/helpers.py b/api/helpers.py similarity index 100% rename from back/api/helpers.py rename to api/helpers.py diff --git a/back/api/locale/fr/LC_MESSAGES/django.po b/api/locale/fr/LC_MESSAGES/django.po similarity index 100% rename from back/api/locale/fr/LC_MESSAGES/django.po rename to api/locale/fr/LC_MESSAGES/django.po diff --git a/back/api/management/commands/fixturize.py b/api/management/commands/fixturize.py similarity index 93% rename from back/api/management/commands/fixturize.py rename to api/management/commands/fixturize.py index 0f44b08a..90d38e13 100644 --- a/back/api/management/commands/fixturize.py +++ b/api/management/commands/fixturize.py @@ -29,7 +29,7 @@ def handle(self, *args, **options): extract_permission.save() extract_user = UserModel.objects.create_user( - username='sitn_extract', password=os.environ['EXTRACT_USER_PASSWORD']) + username='external_provider', password=os.environ['EXTRACT_USER_PASSWORD']) extract_group.permissions.add(extract_permission) extract_group.save() extract_user.groups.add(extract_group) diff --git a/back/api/management/commands/prepareusertests.py b/api/management/commands/prepareusertests.py similarity index 100% rename from back/api/management/commands/prepareusertests.py rename to api/management/commands/prepareusertests.py diff --git a/back/api/migrations/0001_initial.py b/api/migrations/0001_initial.py similarity index 100% rename from back/api/migrations/0001_initial.py rename to api/migrations/0001_initial.py diff --git a/back/api/migrations/0002_auto_20200731_0904.py b/api/migrations/0002_auto_20200731_0904.py similarity index 96% rename from back/api/migrations/0002_auto_20200731_0904.py rename to api/migrations/0002_auto_20200731_0904.py index 00de5414..a92aeba4 100644 --- a/back/api/migrations/0002_auto_20200731_0904.py +++ b/api/migrations/0002_auto_20200731_0904.py @@ -1,24 +1,24 @@ -# Generated by Django 3.0.8 on 2020-07-22 06:41 -import os -from django.db import migrations, models -from django.utils.translation import gettext_lazy as _ - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0001_initial'), - ] - - def generate_superuser(apps, schema_editor): - from django.contrib.auth.models import User - superuser = User.objects.create_superuser( - username='admin', - password=os.environ.get('DJANGO_SU_EMAIL', 'admin')) - - superuser.save() - - - operations = [ - migrations.RunPython(generate_superuser), - ] +# Generated by Django 3.0.8 on 2020-07-22 06:41 +import os +from django.db import migrations, models +from django.utils.translation import gettext_lazy as _ + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0001_initial'), + ] + + def generate_superuser(apps, schema_editor): + from django.contrib.auth.models import User + superuser = User.objects.create_superuser( + username='admin', + password=os.environ.get('DJANGO_SU_EMAIL', 'admin')) + + superuser.save() + + + operations = [ + migrations.RunPython(generate_superuser), + ] diff --git a/back/api/migrations/0003_auto_20200731_1203.py b/api/migrations/0003_auto_20200731_1203.py similarity index 97% rename from back/api/migrations/0003_auto_20200731_1203.py rename to api/migrations/0003_auto_20200731_1203.py index 91f22bc6..5752971a 100644 --- a/back/api/migrations/0003_auto_20200731_1203.py +++ b/api/migrations/0003_auto_20200731_1203.py @@ -1,33 +1,33 @@ -# Generated by Django 3.0.8 on 2020-07-31 10:03 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0002_auto_20200731_0904'), - ] - - operations = [ - migrations.AddField( - model_name='product', - name='thumbnail', - field=models.URLField(default='default_product_thumbnail.png', verbose_name='thumbnail'), - ), - migrations.AlterField( - model_name='document', - name='link', - field=models.URLField(default='default_product_thumbnail.png', help_text='Please complete the above URL', verbose_name='link'), - ), - migrations.AlterField( - model_name='metadata', - name='image_link', - field=models.URLField(default='default_metadata_image.png', verbose_name='image_link'), - ), - migrations.AlterField( - model_name='orderitem', - name='price_status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('CALCULATED', 'Calculated'), ('IMPORTED', 'Imported')], default='PENDING', max_length=20, verbose_name='price_status'), - ), - ] +# Generated by Django 3.0.8 on 2020-07-31 10:03 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0002_auto_20200731_0904'), + ] + + operations = [ + migrations.AddField( + model_name='product', + name='thumbnail', + field=models.URLField(default='default_product_thumbnail.png', verbose_name='thumbnail'), + ), + migrations.AlterField( + model_name='document', + name='link', + field=models.URLField(default='default_product_thumbnail.png', help_text='Please complete the above URL', verbose_name='link'), + ), + migrations.AlterField( + model_name='metadata', + name='image_link', + field=models.URLField(default='default_metadata_image.png', verbose_name='image_link'), + ), + migrations.AlterField( + model_name='orderitem', + name='price_status', + field=models.CharField(choices=[('PENDING', 'Pending'), ('CALCULATED', 'Calculated'), ('IMPORTED', 'Imported')], default='PENDING', max_length=20, verbose_name='price_status'), + ), + ] diff --git a/back/api/migrations/0004_auto_20200731_1339.py b/api/migrations/0004_auto_20200731_1339.py similarity index 96% rename from back/api/migrations/0004_auto_20200731_1339.py rename to api/migrations/0004_auto_20200731_1339.py index e8804d97..460a214c 100644 --- a/back/api/migrations/0004_auto_20200731_1339.py +++ b/api/migrations/0004_auto_20200731_1339.py @@ -1,32 +1,32 @@ -# Generated by Django 3.0.8 on 2020-07-31 11:39 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0003_auto_20200731_1203'), - ] - - operations = [ - migrations.RemoveField( - model_name='product', - name='thumbnail', - ), - migrations.AddField( - model_name='product', - name='thumbnail_link', - field=models.CharField(default='default_product_thumbnail.png', max_length=250, verbose_name='thumbnail'), - ), - migrations.AlterField( - model_name='document', - name='link', - field=models.URLField(default='default_product_thumbnail.png', help_text='Please complete the above URL', verbose_name='link'), - ), - migrations.AlterField( - model_name='metadata', - name='image_link', - field=models.CharField(default='default_metadata_image.png', max_length=250, verbose_name='image_link'), - ), - ] +# Generated by Django 3.0.8 on 2020-07-31 11:39 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0003_auto_20200731_1203'), + ] + + operations = [ + migrations.RemoveField( + model_name='product', + name='thumbnail', + ), + migrations.AddField( + model_name='product', + name='thumbnail_link', + field=models.CharField(default='default_product_thumbnail.png', max_length=250, verbose_name='thumbnail'), + ), + migrations.AlterField( + model_name='document', + name='link', + field=models.URLField(default='default_product_thumbnail.png', help_text='Please complete the above URL', verbose_name='link'), + ), + migrations.AlterField( + model_name='metadata', + name='image_link', + field=models.CharField(default='default_metadata_image.png', max_length=250, verbose_name='image_link'), + ), + ] diff --git a/back/api/migrations/0005_auto_20200803_1706.py b/api/migrations/0005_auto_20200803_1706.py similarity index 97% rename from back/api/migrations/0005_auto_20200803_1706.py rename to api/migrations/0005_auto_20200803_1706.py index 8976bdae..40adb5ad 100644 --- a/back/api/migrations/0005_auto_20200803_1706.py +++ b/api/migrations/0005_auto_20200803_1706.py @@ -1,34 +1,34 @@ -# Generated by Django 3.0.8 on 2020-08-03 15:06 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0004_auto_20200731_1339'), - ] - - operations = [ - migrations.AlterField( - model_name='document', - name='link', - field=models.URLField(default='default_product_thumbnail.png', help_text='Please complete the above URL', verbose_name='link'), - ), - migrations.AlterField( - model_name='metadata', - name='image_link', - field=models.CharField(default='default_metadata_image.png', max_length=250, verbose_name='image_link'), - ), - migrations.AlterField( - model_name='metadatacontact', - name='contact_person', - field=models.ForeignKey(limit_choices_to={'is_public': True}, on_delete=django.db.models.deletion.DO_NOTHING, to='api.Identity', verbose_name='contact_person'), - ), - migrations.AlterField( - model_name='product', - name='thumbnail_link', - field=models.CharField(default='default_product_thumbnail.png', max_length=250, verbose_name='thumbnail_link'), - ), - ] +# Generated by Django 3.0.8 on 2020-08-03 15:06 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0004_auto_20200731_1339'), + ] + + operations = [ + migrations.AlterField( + model_name='document', + name='link', + field=models.URLField(default='default_product_thumbnail.png', help_text='Please complete the above URL', verbose_name='link'), + ), + migrations.AlterField( + model_name='metadata', + name='image_link', + field=models.CharField(default='default_metadata_image.png', max_length=250, verbose_name='image_link'), + ), + migrations.AlterField( + model_name='metadatacontact', + name='contact_person', + field=models.ForeignKey(limit_choices_to={'is_public': True}, on_delete=django.db.models.deletion.DO_NOTHING, to='api.Identity', verbose_name='contact_person'), + ), + migrations.AlterField( + model_name='product', + name='thumbnail_link', + field=models.CharField(default='default_product_thumbnail.png', max_length=250, verbose_name='thumbnail_link'), + ), + ] diff --git a/back/api/migrations/0006_auto_20200805_0843.py b/api/migrations/0006_auto_20200805_0843.py similarity index 97% rename from back/api/migrations/0006_auto_20200805_0843.py rename to api/migrations/0006_auto_20200805_0843.py index 83576319..d6a61304 100644 --- a/back/api/migrations/0006_auto_20200805_0843.py +++ b/api/migrations/0006_auto_20200805_0843.py @@ -1,53 +1,53 @@ -# Generated by Django 3.0.8 on 2020-08-05 06:43 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0005_auto_20200803_1706'), - ] - - operations = [ - migrations.AlterField( - model_name='contact', - name='company_name', - field=models.CharField(blank=True, max_length=250, verbose_name='company_name'), - ), - migrations.AlterField( - model_name='contact', - name='first_name', - field=models.CharField(blank=True, max_length=50, verbose_name='first_name'), - ), - migrations.AlterField( - model_name='identity', - name='company_name', - field=models.CharField(blank=True, max_length=250, verbose_name='company_name'), - ), - migrations.AlterField( - model_name='identity', - name='first_name', - field=models.CharField(blank=True, max_length=50, verbose_name='first_name'), - ), - migrations.AlterField( - model_name='pricing', - name='name', - field=models.CharField(blank=True, max_length=100, null=True, verbose_name='name'), - ), - migrations.AlterField( - model_name='product', - name='order', - field=models.BigIntegerField(blank=True, null=True, verbose_name='order_index'), - ), - migrations.AlterField( - model_name='userchange', - name='company_name', - field=models.CharField(blank=True, max_length=250, verbose_name='company_name'), - ), - migrations.AlterField( - model_name='userchange', - name='first_name', - field=models.CharField(blank=True, max_length=50, verbose_name='first_name'), - ), - ] +# Generated by Django 3.0.8 on 2020-08-05 06:43 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0005_auto_20200803_1706'), + ] + + operations = [ + migrations.AlterField( + model_name='contact', + name='company_name', + field=models.CharField(blank=True, max_length=250, verbose_name='company_name'), + ), + migrations.AlterField( + model_name='contact', + name='first_name', + field=models.CharField(blank=True, max_length=50, verbose_name='first_name'), + ), + migrations.AlterField( + model_name='identity', + name='company_name', + field=models.CharField(blank=True, max_length=250, verbose_name='company_name'), + ), + migrations.AlterField( + model_name='identity', + name='first_name', + field=models.CharField(blank=True, max_length=50, verbose_name='first_name'), + ), + migrations.AlterField( + model_name='pricing', + name='name', + field=models.CharField(blank=True, max_length=100, null=True, verbose_name='name'), + ), + migrations.AlterField( + model_name='product', + name='order', + field=models.BigIntegerField(blank=True, null=True, verbose_name='order_index'), + ), + migrations.AlterField( + model_name='userchange', + name='company_name', + field=models.CharField(blank=True, max_length=250, verbose_name='company_name'), + ), + migrations.AlterField( + model_name='userchange', + name='first_name', + field=models.CharField(blank=True, max_length=50, verbose_name='first_name'), + ), + ] diff --git a/back/api/migrations/0007_auto_20200805_1138.py b/api/migrations/0007_auto_20200805_1138.py similarity index 96% rename from back/api/migrations/0007_auto_20200805_1138.py rename to api/migrations/0007_auto_20200805_1138.py index 73cd13f9..86770688 100644 --- a/back/api/migrations/0007_auto_20200805_1138.py +++ b/api/migrations/0007_auto_20200805_1138.py @@ -1,19 +1,19 @@ -# Generated by Django 3.0.8 on 2020-08-05 09:38 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0006_auto_20200805_0843'), - ] - - operations = [ - migrations.AlterField( - model_name='product', - name='group', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='api.Product', verbose_name='group'), - ), - ] +# Generated by Django 3.0.8 on 2020-08-05 09:38 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0006_auto_20200805_0843'), + ] + + operations = [ + migrations.AlterField( + model_name='product', + name='group', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='api.Product', verbose_name='group'), + ), + ] diff --git a/back/api/migrations/0008_orderitem_extract_result.py b/api/migrations/0008_orderitem_extract_result.py similarity index 95% rename from back/api/migrations/0008_orderitem_extract_result.py rename to api/migrations/0008_orderitem_extract_result.py index 00ebd081..119b30fe 100644 --- a/back/api/migrations/0008_orderitem_extract_result.py +++ b/api/migrations/0008_orderitem_extract_result.py @@ -1,18 +1,18 @@ -# Generated by Django 3.0.8 on 2020-08-11 11:07 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0007_auto_20200805_1138'), - ] - - operations = [ - migrations.AddField( - model_name='orderitem', - name='extract_result', - field=models.FileField(blank=True, null=True, upload_to='extract'), - ), - ] +# Generated by Django 3.0.8 on 2020-08-11 11:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0007_auto_20200805_1138'), + ] + + operations = [ + migrations.AddField( + model_name='orderitem', + name='extract_result', + field=models.FileField(blank=True, null=True, upload_to='extract'), + ), + ] diff --git a/back/api/migrations/0009_auto_20200811_1645.py b/api/migrations/0009_auto_20200811_1645.py similarity index 96% rename from back/api/migrations/0009_auto_20200811_1645.py rename to api/migrations/0009_auto_20200811_1645.py index 18ffc914..6fa8257e 100644 --- a/back/api/migrations/0009_auto_20200811_1645.py +++ b/api/migrations/0009_auto_20200811_1645.py @@ -1,19 +1,19 @@ -# Generated by Django 3.0.8 on 2020-08-11 14:45 - -import api.helpers -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0008_orderitem_extract_result'), - ] - - operations = [ - migrations.AlterField( - model_name='orderitem', - name='extract_result', - field=models.FileField(blank=True, null=True, upload_to=api.helpers.RandomFileName('extract')), - ), - ] +# Generated by Django 3.0.8 on 2020-08-11 14:45 + +import api.helpers +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0008_orderitem_extract_result'), + ] + + operations = [ + migrations.AlterField( + model_name='orderitem', + name='extract_result', + field=models.FileField(blank=True, null=True, upload_to=api.helpers.RandomFileName('extract')), + ), + ] diff --git a/back/api/migrations/0010_auto_20200814_1212.py b/api/migrations/0010_auto_20200814_1212.py similarity index 97% rename from back/api/migrations/0010_auto_20200814_1212.py rename to api/migrations/0010_auto_20200814_1212.py index 4992c7d9..182eb106 100644 --- a/back/api/migrations/0010_auto_20200814_1212.py +++ b/api/migrations/0010_auto_20200814_1212.py @@ -1,37 +1,37 @@ -# Generated by Django 3.0.8 on 2020-08-14 10:12 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0009_auto_20200811_1645'), - ] - - operations = [ - migrations.RemoveField( - model_name='order', - name='order_contact', - ), - migrations.AddField( - model_name='orderitem', - name='srid', - field=models.IntegerField(default=2056, verbose_name='srid'), - ), - migrations.AlterField( - model_name='document', - name='link', - field=models.URLField(default='default_product_thumbnail.png', help_text='Please complete the above URL', verbose_name='link'), - ), - migrations.AlterField( - model_name='metadata', - name='image_link', - field=models.CharField(default='default_metadata_image.png', max_length=250, verbose_name='image_link'), - ), - migrations.AlterField( - model_name='product', - name='thumbnail_link', - field=models.CharField(default='default_product_thumbnail.png', max_length=250, verbose_name='thumbnail_link'), - ), - ] +# Generated by Django 3.0.8 on 2020-08-14 10:12 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0009_auto_20200811_1645'), + ] + + operations = [ + migrations.RemoveField( + model_name='order', + name='order_contact', + ), + migrations.AddField( + model_name='orderitem', + name='srid', + field=models.IntegerField(default=2056, verbose_name='srid'), + ), + migrations.AlterField( + model_name='document', + name='link', + field=models.URLField(default='default_product_thumbnail.png', help_text='Please complete the above URL', verbose_name='link'), + ), + migrations.AlterField( + model_name='metadata', + name='image_link', + field=models.CharField(default='default_metadata_image.png', max_length=250, verbose_name='image_link'), + ), + migrations.AlterField( + model_name='product', + name='thumbnail_link', + field=models.CharField(default='default_product_thumbnail.png', max_length=250, verbose_name='thumbnail_link'), + ), + ] diff --git a/back/api/migrations/0011_auto_20200814_1559.py b/api/migrations/0011_auto_20200814_1559.py similarity index 96% rename from back/api/migrations/0011_auto_20200814_1559.py rename to api/migrations/0011_auto_20200814_1559.py index 7898df6f..3a5d3723 100644 --- a/back/api/migrations/0011_auto_20200814_1559.py +++ b/api/migrations/0011_auto_20200814_1559.py @@ -1,23 +1,23 @@ -# Generated by Django 3.0.8 on 2020-08-14 13:59 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0010_auto_20200814_1212'), - ] - - operations = [ - migrations.AddField( - model_name='contact', - name='sap_id', - field=models.BigIntegerField(blank=True, null=True, verbose_name='sap_id'), - ), - migrations.AddField( - model_name='product', - name='provider', - field=models.CharField(default='SITN', max_length=30, verbose_name='provider'), - ), - ] +# Generated by Django 3.0.8 on 2020-08-14 13:59 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0010_auto_20200814_1212'), + ] + + operations = [ + migrations.AddField( + model_name='contact', + name='sap_id', + field=models.BigIntegerField(blank=True, null=True, verbose_name='sap_id'), + ), + migrations.AddField( + model_name='product', + name='provider', + field=models.CharField(default='SITN', max_length=30, verbose_name='provider'), + ), + ] diff --git a/back/api/migrations/0012_auto_20201005_1620.py b/api/migrations/0012_auto_20201005_1620.py similarity index 96% rename from back/api/migrations/0012_auto_20201005_1620.py rename to api/migrations/0012_auto_20201005_1620.py index 40549b1d..33116414 100644 --- a/back/api/migrations/0012_auto_20201005_1620.py +++ b/api/migrations/0012_auto_20201005_1620.py @@ -1,19 +1,19 @@ -# Generated by Django 3.0.8 on 2020-10-05 14:20 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0011_auto_20200814_1559'), - ] - - operations = [ - migrations.AlterField( - model_name='orderitem', - name='order', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='items', to='api.Order', verbose_name='order'), - ), - ] +# Generated by Django 3.0.8 on 2020-10-05 14:20 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0011_auto_20200814_1559'), + ] + + operations = [ + migrations.AlterField( + model_name='orderitem', + name='order', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='items', to='api.Order', verbose_name='order'), + ), + ] diff --git a/back/api/migrations/0013_auto_20201009_1513.py b/api/migrations/0013_auto_20201009_1513.py similarity index 96% rename from back/api/migrations/0013_auto_20201009_1513.py rename to api/migrations/0013_auto_20201009_1513.py index 5c995f33..b22a1426 100644 --- a/back/api/migrations/0013_auto_20201009_1513.py +++ b/api/migrations/0013_auto_20201009_1513.py @@ -1,19 +1,19 @@ -# Generated by Django 3.0.8 on 2020-10-09 13:13 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0012_auto_20201005_1620'), - ] - - operations = [ - migrations.AlterField( - model_name='order', - name='invoice_contact', - field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='invoice_contact', to='api.Contact', verbose_name='invoice_contact'), - ), - ] +# Generated by Django 3.0.8 on 2020-10-09 13:13 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0012_auto_20201005_1620'), + ] + + operations = [ + migrations.AlterField( + model_name='order', + name='invoice_contact', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='invoice_contact', to='api.Contact', verbose_name='invoice_contact'), + ), + ] diff --git a/back/api/migrations/0014_auto_20201014_1549.py b/api/migrations/0014_auto_20201014_1549.py similarity index 95% rename from back/api/migrations/0014_auto_20201014_1549.py rename to api/migrations/0014_auto_20201014_1549.py index 4ceffa6b..1a8f09c0 100644 --- a/back/api/migrations/0014_auto_20201014_1549.py +++ b/api/migrations/0014_auto_20201014_1549.py @@ -1,17 +1,17 @@ -# Generated by Django 3.0.8 on 2020-10-14 13:49 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0013_auto_20201009_1513'), - ] - - operations = [ - migrations.RenameModel( - old_name='PricingArea', - new_name='PricingGeometry', - ), - ] +# Generated by Django 3.0.8 on 2020-10-14 13:49 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0013_auto_20201009_1513'), + ] + + operations = [ + migrations.RenameModel( + old_name='PricingArea', + new_name='PricingGeometry', + ), + ] diff --git a/back/api/migrations/0015_product_free_when_subscribed.py b/api/migrations/0015_product_free_when_subscribed.py similarity index 96% rename from back/api/migrations/0015_product_free_when_subscribed.py rename to api/migrations/0015_product_free_when_subscribed.py index ec002321..1fbb0b8a 100644 --- a/back/api/migrations/0015_product_free_when_subscribed.py +++ b/api/migrations/0015_product_free_when_subscribed.py @@ -1,18 +1,18 @@ -# Generated by Django 3.0.8 on 2020-12-04 16:20 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0014_auto_20201014_1549'), - ] - - operations = [ - migrations.AddField( - model_name='product', - name='free_when_subscribed', - field=models.BooleanField(default=False, verbose_name='free_when_subscribed'), - ), - ] +# Generated by Django 3.0.8 on 2020-12-04 16:20 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0014_auto_20201014_1549'), + ] + + operations = [ + migrations.AddField( + model_name='product', + name='free_when_subscribed', + field=models.BooleanField(default=False, verbose_name='free_when_subscribed'), + ), + ] diff --git a/back/api/migrations/0016_contact_subscribed.py b/api/migrations/0016_contact_subscribed.py similarity index 96% rename from back/api/migrations/0016_contact_subscribed.py rename to api/migrations/0016_contact_subscribed.py index 48ffc80b..0282c3d8 100644 --- a/back/api/migrations/0016_contact_subscribed.py +++ b/api/migrations/0016_contact_subscribed.py @@ -1,26 +1,26 @@ -# Generated by Django 3.0.8 on 2020-12-08 09:24 - -from django.conf import settings -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0015_product_free_when_subscribed'), - ] - - operations = [ - migrations.AddField( - model_name='contact', - name='subscribed', - field=models.BooleanField(default=False, verbose_name='subscribed'), - ), - migrations.AddField( - model_name='userchange', - name='client', - field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, verbose_name='client'), - preserve_default=False, - ), - ] +# Generated by Django 3.0.8 on 2020-12-08 09:24 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0015_product_free_when_subscribed'), + ] + + operations = [ + migrations.AddField( + model_name='contact', + name='subscribed', + field=models.BooleanField(default=False, verbose_name='subscribed'), + ), + migrations.AddField( + model_name='userchange', + name='client', + field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL, verbose_name='client'), + preserve_default=False, + ), + ] diff --git a/back/api/migrations/0017_auto_20201209_0807.py b/api/migrations/0017_auto_20201209_0807.py similarity index 97% rename from back/api/migrations/0017_auto_20201209_0807.py rename to api/migrations/0017_auto_20201209_0807.py index ac5a0f83..655c4525 100644 --- a/back/api/migrations/0017_auto_20201209_0807.py +++ b/api/migrations/0017_auto_20201209_0807.py @@ -1,24 +1,24 @@ -# Generated by Django 3.0.8 on 2020-12-09 07:07 - -from django.db import migrations, models -from django.conf import settings - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0016_contact_subscribed'), - ] - - operations = [ - migrations.AddField( - model_name='order', - name='extract_result', - field=models.FileField(blank=True, null=True, upload_to='extract'), - ), - migrations.AlterField( - model_name='order', - name='status', - field=models.CharField(choices=[('DRAFT', 'Draft'), ('PENDING', 'Pending'), ('READY', 'Ready'), ('PARTIALLY_DELIVERED', 'Partially delivered'), ('PROCESSED', 'Processed'), ('ARCHIVED', 'Archived'), ('REJECTED', 'Rejected')], default='DRAFT', max_length=20, verbose_name='status'), - ), - ] +# Generated by Django 3.0.8 on 2020-12-09 07:07 + +from django.db import migrations, models +from django.conf import settings + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0016_contact_subscribed'), + ] + + operations = [ + migrations.AddField( + model_name='order', + name='extract_result', + field=models.FileField(blank=True, null=True, upload_to='extract'), + ), + migrations.AlterField( + model_name='order', + name='status', + field=models.CharField(choices=[('DRAFT', 'Draft'), ('PENDING', 'Pending'), ('READY', 'Ready'), ('PARTIALLY_DELIVERED', 'Partially delivered'), ('PROCESSED', 'Processed'), ('ARCHIVED', 'Archived'), ('REJECTED', 'Rejected')], default='DRAFT', max_length=20, verbose_name='status'), + ), + ] diff --git a/back/api/migrations/0018_orderitem_status.py b/api/migrations/0018_orderitem_status.py similarity index 96% rename from back/api/migrations/0018_orderitem_status.py rename to api/migrations/0018_orderitem_status.py index 63db42a5..40ed2318 100644 --- a/back/api/migrations/0018_orderitem_status.py +++ b/api/migrations/0018_orderitem_status.py @@ -1,18 +1,18 @@ -# Generated by Django 3.0.8 on 2020-12-09 10:39 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0017_auto_20201209_0807'), - ] - - operations = [ - migrations.AddField( - model_name='orderitem', - name='status', - field=models.CharField(choices=[('PENDING', 'Pending'), ('PROCESSED', 'Processed'), ('ARCHIVED', 'Archived')], default='PENDING', max_length=20, verbose_name='status'), - ), - ] +# Generated by Django 3.0.8 on 2020-12-09 10:39 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0017_auto_20201209_0807'), + ] + + operations = [ + migrations.AddField( + model_name='orderitem', + name='status', + field=models.CharField(choices=[('PENDING', 'Pending'), ('PROCESSED', 'Processed'), ('ARCHIVED', 'Archived')], default='PENDING', max_length=20, verbose_name='status'), + ), + ] diff --git a/back/api/migrations/0019_auto_20201218_0902.py b/api/migrations/0019_auto_20201218_0902.py similarity index 97% rename from back/api/migrations/0019_auto_20201218_0902.py rename to api/migrations/0019_auto_20201218_0902.py index 5fdd6efc..1f870e13 100644 --- a/back/api/migrations/0019_auto_20201218_0902.py +++ b/api/migrations/0019_auto_20201218_0902.py @@ -1,23 +1,23 @@ -# Generated by Django 3.0.8 on 2020-12-18 08:02 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0018_orderitem_status'), - ] - - operations = [ - migrations.AlterField( - model_name='metadatacontact', - name='metadata_role', - field=models.CharField(default='Gestionnaire', max_length=150, verbose_name='role'), - ), - migrations.AlterField( - model_name='order', - name='status', - field=models.CharField(choices=[('DRAFT', 'Draft'), ('PENDING', 'Pending'), ('READY', 'Ready'), ('IN_EXTRACT', 'In extract'), ('PARTIALLY_DELIVERED', 'Partially delivered'), ('PROCESSED', 'Processed'), ('ARCHIVED', 'Archived'), ('REJECTED', 'Rejected')], default='DRAFT', max_length=20, verbose_name='status'), - ), - ] +# Generated by Django 3.0.8 on 2020-12-18 08:02 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0018_orderitem_status'), + ] + + operations = [ + migrations.AlterField( + model_name='metadatacontact', + name='metadata_role', + field=models.CharField(default='Gestionnaire', max_length=150, verbose_name='role'), + ), + migrations.AlterField( + model_name='order', + name='status', + field=models.CharField(choices=[('DRAFT', 'Draft'), ('PENDING', 'Pending'), ('READY', 'Ready'), ('IN_EXTRACT', 'In extract'), ('PARTIALLY_DELIVERED', 'Partially delivered'), ('PROCESSED', 'Processed'), ('ARCHIVED', 'Archived'), ('REJECTED', 'Rejected')], default='DRAFT', max_length=20, verbose_name='status'), + ), + ] diff --git a/back/api/migrations/0020_auto_20210108_1749.py b/api/migrations/0020_auto_20210108_1749.py similarity index 96% rename from back/api/migrations/0020_auto_20210108_1749.py rename to api/migrations/0020_auto_20210108_1749.py index 325cae89..8015c389 100644 --- a/back/api/migrations/0020_auto_20210108_1749.py +++ b/api/migrations/0020_auto_20210108_1749.py @@ -1,18 +1,18 @@ -# Generated by Django 3.0.8 on 2021-01-08 16:49 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('api', '0019_auto_20201218_0902'), - ] - - operations = [ - migrations.AlterField( - model_name='document', - name='link', - field=models.URLField(default='images/default_product_thumbnail.png', help_text='Please complete the above URL', max_length=2000, verbose_name='link'), - ), - ] +# Generated by Django 3.0.8 on 2021-01-08 16:49 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0019_auto_20201218_0902'), + ] + + operations = [ + migrations.AlterField( + model_name='document', + name='link', + field=models.URLField(default='images/default_product_thumbnail.png', help_text='Please complete the above URL', max_length=2000, verbose_name='link'), + ), + ] diff --git a/back/api/migrations/0021_auto_20210115_1547.py b/api/migrations/0021_auto_20210115_1547.py similarity index 100% rename from back/api/migrations/0021_auto_20210115_1547.py rename to api/migrations/0021_auto_20210115_1547.py diff --git a/back/api/migrations/0022_auto_20210129_1804.py b/api/migrations/0022_auto_20210129_1804.py similarity index 100% rename from back/api/migrations/0022_auto_20210129_1804.py rename to api/migrations/0022_auto_20210129_1804.py diff --git a/back/api/migrations/0023_auto_20210224_1542.py b/api/migrations/0023_auto_20210224_1542.py similarity index 100% rename from back/api/migrations/0023_auto_20210224_1542.py rename to api/migrations/0023_auto_20210224_1542.py diff --git a/back/api/migrations/0024_auto_20210226_0950.py b/api/migrations/0024_auto_20210226_0950.py similarity index 100% rename from back/api/migrations/0024_auto_20210226_0950.py rename to api/migrations/0024_auto_20210226_0950.py diff --git a/back/api/migrations/0025_metadata_datasource.py b/api/migrations/0025_metadata_datasource.py similarity index 100% rename from back/api/migrations/0025_metadata_datasource.py rename to api/migrations/0025_metadata_datasource.py diff --git a/back/api/migrations/0026_auto_20210409_1428.py b/api/migrations/0026_auto_20210409_1428.py similarity index 100% rename from back/api/migrations/0026_auto_20210409_1428.py rename to api/migrations/0026_auto_20210409_1428.py diff --git a/back/api/migrations/0027_order_email_deliver.py b/api/migrations/0027_order_email_deliver.py similarity index 100% rename from back/api/migrations/0027_order_email_deliver.py rename to api/migrations/0027_order_email_deliver.py diff --git a/back/api/migrations/0028_auto_20210510_1528.py b/api/migrations/0028_auto_20210510_1528.py similarity index 100% rename from back/api/migrations/0028_auto_20210510_1528.py rename to api/migrations/0028_auto_20210510_1528.py diff --git a/back/api/migrations/0029_auto_20210604_1417.py b/api/migrations/0029_auto_20210604_1417.py similarity index 95% rename from back/api/migrations/0029_auto_20210604_1417.py rename to api/migrations/0029_auto_20210604_1417.py index 67925954..aa875d7d 100644 --- a/back/api/migrations/0029_auto_20210604_1417.py +++ b/api/migrations/0029_auto_20210604_1417.py @@ -27,7 +27,7 @@ class Migration(migrations.Migration): field=models.ForeignKey(limit_choices_to={'groups__name': 'extract'}, null=True, on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL, verbose_name='provider'), ), migrations.RunSQL( - sql=[("UPDATE product SET provider_id = (SELECT id FROM auth_user WHERE username=%s);", ['sitn_extract'])], + sql=[("UPDATE product SET provider_id = (SELECT id FROM auth_user WHERE username=%s);", ['external_provider'])], reverse_sql=[("SELECT 1;")], ), ] diff --git a/back/api/migrations/0030_auto_20210707_1357.py b/api/migrations/0030_auto_20210707_1357.py similarity index 100% rename from back/api/migrations/0030_auto_20210707_1357.py rename to api/migrations/0030_auto_20210707_1357.py diff --git a/back/api/migrations/0031_product_geom.py b/api/migrations/0031_product_geom.py similarity index 100% rename from back/api/migrations/0031_product_geom.py rename to api/migrations/0031_product_geom.py diff --git a/back/api/migrations/0032_auto_20211221_1223.py b/api/migrations/0032_auto_20211221_1223.py similarity index 100% rename from back/api/migrations/0032_auto_20211221_1223.py rename to api/migrations/0032_auto_20211221_1223.py diff --git a/back/api/migrations/0033_auto_20211221_1431.py b/api/migrations/0033_auto_20211221_1431.py similarity index 100% rename from back/api/migrations/0033_auto_20211221_1431.py rename to api/migrations/0033_auto_20211221_1431.py diff --git a/back/api/migrations/0034_alter_product_label.py b/api/migrations/0034_alter_product_label.py similarity index 100% rename from back/api/migrations/0034_alter_product_label.py rename to api/migrations/0034_alter_product_label.py diff --git a/back/api/migrations/0035_auto_20220103_1630.py b/api/migrations/0035_auto_20220103_1630.py similarity index 100% rename from back/api/migrations/0035_auto_20220103_1630.py rename to api/migrations/0035_auto_20220103_1630.py diff --git a/back/api/migrations/0036_orderitem_validation_date.py b/api/migrations/0036_orderitem_validation_date.py similarity index 100% rename from back/api/migrations/0036_orderitem_validation_date.py rename to api/migrations/0036_orderitem_validation_date.py diff --git a/back/api/migrations/0037_alter_product_metadata.py b/api/migrations/0037_alter_product_metadata.py similarity index 100% rename from back/api/migrations/0037_alter_product_metadata.py rename to api/migrations/0037_alter_product_metadata.py diff --git a/back/api/migrations/0038_metadatacontact_is_validator.py b/api/migrations/0038_metadatacontact_is_validator.py similarity index 100% rename from back/api/migrations/0038_metadatacontact_is_validator.py rename to api/migrations/0038_metadatacontact_is_validator.py diff --git a/back/api/migrations/0039_alter_product_geom.py b/api/migrations/0039_alter_product_geom.py similarity index 100% rename from back/api/migrations/0039_alter_product_geom.py rename to api/migrations/0039_alter_product_geom.py diff --git a/back/api/migrations/0040_alter_product_provider.py b/api/migrations/0040_alter_product_provider.py similarity index 100% rename from back/api/migrations/0040_alter_product_provider.py rename to api/migrations/0040_alter_product_provider.py diff --git a/back/api/migrations/0041_alter_metadata_accessibility.py b/api/migrations/0041_alter_metadata_accessibility.py similarity index 100% rename from back/api/migrations/0041_alter_metadata_accessibility.py rename to api/migrations/0041_alter_metadata_accessibility.py diff --git a/back/api/migrations/0042_auto_20220727_1327.py b/api/migrations/0042_auto_20220727_1327.py similarity index 100% rename from back/api/migrations/0042_auto_20220727_1327.py rename to api/migrations/0042_auto_20220727_1327.py diff --git a/back/api/migrations/0043_auto_20220727_1337.py b/api/migrations/0043_auto_20220727_1337.py similarity index 100% rename from back/api/migrations/0043_auto_20220727_1337.py rename to api/migrations/0043_auto_20220727_1337.py diff --git a/back/api/migrations/0044_metadata_geoportal_link_metadata_wms_link_and_more.py b/api/migrations/0044_metadata_geoportal_link_metadata_wms_link_and_more.py similarity index 100% rename from back/api/migrations/0044_metadata_geoportal_link_metadata_wms_link_and_more.py rename to api/migrations/0044_metadata_geoportal_link_metadata_wms_link_and_more.py diff --git a/back/api/migrations/0045_alter_metadata_data_last_update_date_and_more.py b/api/migrations/0045_alter_metadata_data_last_update_date_and_more.py similarity index 100% rename from back/api/migrations/0045_alter_metadata_data_last_update_date_and_more.py rename to api/migrations/0045_alter_metadata_data_last_update_date_and_more.py diff --git a/back/api/migrations/0046_alter_metadata_options.py b/api/migrations/0046_alter_metadata_options.py similarity index 100% rename from back/api/migrations/0046_alter_metadata_options.py rename to api/migrations/0046_alter_metadata_options.py diff --git a/api/migrations/0047_alter_document_link_and_more.py b/api/migrations/0047_alter_document_link_and_more.py new file mode 100644 index 00000000..052ef70c --- /dev/null +++ b/api/migrations/0047_alter_document_link_and_more.py @@ -0,0 +1,3561 @@ +# Generated by Django 4.1.10 on 2024-01-23 14:24 + +from django.db import migrations, models +import djmoney.models.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ("api", "0046_alter_metadata_options"), + ] + + operations = [ + migrations.AlterField( + model_name="document", + name="link", + field=models.URLField( + help_text="Please complete the above URL", + max_length=2000, + verbose_name="link", + ), + ), + migrations.AlterField( + model_name="metadatacontact", + name="metadata_role", + field=models.CharField( + default="Manager", max_length=150, verbose_name="role" + ), + ), + migrations.AlterField( + model_name="order", + name="part_vat_currency", + field=djmoney.models.fields.CurrencyField( + choices=[ + ("XUA", "ADB Unit of Account"), + ("AFN", "Afghan Afghani"), + ("AFA", "Afghan Afghani (1927–2002)"), + ("ALL", "Albanian Lek"), + ("ALK", "Albanian Lek (1946–1965)"), + ("DZD", "Algerian Dinar"), + ("ADP", "Andorran Peseta"), + ("AOA", "Angolan Kwanza"), + ("AOK", "Angolan Kwanza (1977–1991)"), + ("AON", "Angolan New Kwanza (1990–2000)"), + ("AOR", "Angolan Readjusted Kwanza (1995–1999)"), + ("ARA", "Argentine Austral"), + ("ARS", "Argentine Peso"), + ("ARM", "Argentine Peso (1881–1970)"), + ("ARP", "Argentine Peso (1983–1985)"), + ("ARL", "Argentine Peso Ley (1970–1983)"), + ("AMD", "Armenian Dram"), + ("AWG", "Aruban Florin"), + ("AUD", "Australian Dollar"), + ("ATS", "Austrian Schilling"), + ("AZN", "Azerbaijani Manat"), + ("AZM", "Azerbaijani Manat (1993–2006)"), + ("BSD", "Bahamian Dollar"), + ("BHD", "Bahraini Dinar"), + ("BDT", "Bangladeshi Taka"), + ("BBD", "Barbadian Dollar"), + ("BYN", "Belarusian Ruble"), + ("BYB", "Belarusian Ruble (1994–1999)"), + ("BYR", "Belarusian Ruble (2000–2016)"), + ("BEF", "Belgian Franc"), + ("BEC", "Belgian Franc (convertible)"), + ("BEL", "Belgian Franc (financial)"), + ("BZD", "Belize Dollar"), + ("BMD", "Bermudan Dollar"), + ("BTN", "Bhutanese Ngultrum"), + ("BOB", "Bolivian Boliviano"), + ("BOL", "Bolivian Boliviano (1863–1963)"), + ("BOV", "Bolivian Mvdol"), + ("BOP", "Bolivian Peso"), + ("BAM", "Bosnia-Herzegovina Convertible Mark"), + ("BAD", "Bosnia-Herzegovina Dinar (1992–1994)"), + ("BAN", "Bosnia-Herzegovina New Dinar (1994–1997)"), + ("BWP", "Botswanan Pula"), + ("BRC", "Brazilian Cruzado (1986–1989)"), + ("BRZ", "Brazilian Cruzeiro (1942–1967)"), + ("BRE", "Brazilian Cruzeiro (1990–1993)"), + ("BRR", "Brazilian Cruzeiro (1993–1994)"), + ("BRN", "Brazilian New Cruzado (1989–1990)"), + ("BRB", "Brazilian New Cruzeiro (1967–1986)"), + ("BRL", "Brazilian Real"), + ("GBP", "British Pound"), + ("BND", "Brunei Dollar"), + ("BGL", "Bulgarian Hard Lev"), + ("BGN", "Bulgarian Lev"), + ("BGO", "Bulgarian Lev (1879–1952)"), + ("BGM", "Bulgarian Socialist Lev"), + ("BUK", "Burmese Kyat"), + ("BIF", "Burundian Franc"), + ("XPF", "CFP Franc"), + ("KHR", "Cambodian Riel"), + ("CAD", "Canadian Dollar"), + ("CVE", "Cape Verdean Escudo"), + ("KYD", "Cayman Islands Dollar"), + ("XAF", "Central African CFA Franc"), + ("CLE", "Chilean Escudo"), + ("CLP", "Chilean Peso"), + ("CLF", "Chilean Unit of Account (UF)"), + ("CNX", "Chinese People’s Bank Dollar"), + ("CNY", "Chinese Yuan"), + ("CNH", "Chinese Yuan (offshore)"), + ("COP", "Colombian Peso"), + ("COU", "Colombian Real Value Unit"), + ("KMF", "Comorian Franc"), + ("CDF", "Congolese Franc"), + ("CRC", "Costa Rican Colón"), + ("HRD", "Croatian Dinar"), + ("HRK", "Croatian Kuna"), + ("CUC", "Cuban Convertible Peso"), + ("CUP", "Cuban Peso"), + ("CYP", "Cypriot Pound"), + ("CZK", "Czech Koruna"), + ("CSK", "Czechoslovak Hard Koruna"), + ("DKK", "Danish Krone"), + ("DJF", "Djiboutian Franc"), + ("DOP", "Dominican Peso"), + ("NLG", "Dutch Guilder"), + ("XCD", "East Caribbean Dollar"), + ("DDM", "East German Mark"), + ("ECS", "Ecuadorian Sucre"), + ("ECV", "Ecuadorian Unit of Constant Value"), + ("EGP", "Egyptian Pound"), + ("GQE", "Equatorial Guinean Ekwele"), + ("ERN", "Eritrean Nakfa"), + ("EEK", "Estonian Kroon"), + ("ETB", "Ethiopian Birr"), + ("EUR", "Euro"), + ("XBA", "European Composite Unit"), + ("XEU", "European Currency Unit"), + ("XBB", "European Monetary Unit"), + ("XBC", "European Unit of Account (XBC)"), + ("XBD", "European Unit of Account (XBD)"), + ("FKP", "Falkland Islands Pound"), + ("FJD", "Fijian Dollar"), + ("FIM", "Finnish Markka"), + ("FRF", "French Franc"), + ("XFO", "French Gold Franc"), + ("XFU", "French UIC-Franc"), + ("GMD", "Gambian Dalasi"), + ("GEK", "Georgian Kupon Larit"), + ("GEL", "Georgian Lari"), + ("DEM", "German Mark"), + ("GHS", "Ghanaian Cedi"), + ("GHC", "Ghanaian Cedi (1979–2007)"), + ("GIP", "Gibraltar Pound"), + ("XAU", "Gold"), + ("GRD", "Greek Drachma"), + ("GTQ", "Guatemalan Quetzal"), + ("GWP", "Guinea-Bissau Peso"), + ("GNF", "Guinean Franc"), + ("GNS", "Guinean Syli"), + ("GYD", "Guyanaese Dollar"), + ("HTG", "Haitian Gourde"), + ("HNL", "Honduran Lempira"), + ("HKD", "Hong Kong Dollar"), + ("HUF", "Hungarian Forint"), + ("IMP", "IMP"), + ("ISK", "Icelandic Króna"), + ("ISJ", "Icelandic Króna (1918–1981)"), + ("INR", "Indian Rupee"), + ("IDR", "Indonesian Rupiah"), + ("IRR", "Iranian Rial"), + ("IQD", "Iraqi Dinar"), + ("IEP", "Irish Pound"), + ("ILS", "Israeli New Shekel"), + ("ILP", "Israeli Pound"), + ("ILR", "Israeli Shekel (1980–1985)"), + ("ITL", "Italian Lira"), + ("JMD", "Jamaican Dollar"), + ("JPY", "Japanese Yen"), + ("JOD", "Jordanian Dinar"), + ("KZT", "Kazakhstani Tenge"), + ("KES", "Kenyan Shilling"), + ("KWD", "Kuwaiti Dinar"), + ("KGS", "Kyrgystani Som"), + ("LAK", "Laotian Kip"), + ("LVL", "Latvian Lats"), + ("LVR", "Latvian Ruble"), + ("LBP", "Lebanese Pound"), + ("LSL", "Lesotho Loti"), + ("LRD", "Liberian Dollar"), + ("LYD", "Libyan Dinar"), + ("LTL", "Lithuanian Litas"), + ("LTT", "Lithuanian Talonas"), + ("LUL", "Luxembourg Financial Franc"), + ("LUC", "Luxembourgian Convertible Franc"), + ("LUF", "Luxembourgian Franc"), + ("MOP", "Macanese Pataca"), + ("MKD", "Macedonian Denar"), + ("MKN", "Macedonian Denar (1992–1993)"), + ("MGA", "Malagasy Ariary"), + ("MGF", "Malagasy Franc"), + ("MWK", "Malawian Kwacha"), + ("MYR", "Malaysian Ringgit"), + ("MVR", "Maldivian Rufiyaa"), + ("MVP", "Maldivian Rupee (1947–1981)"), + ("MLF", "Malian Franc"), + ("MTL", "Maltese Lira"), + ("MTP", "Maltese Pound"), + ("MRU", "Mauritanian Ouguiya"), + ("MRO", "Mauritanian Ouguiya (1973–2017)"), + ("MUR", "Mauritian Rupee"), + ("MXV", "Mexican Investment Unit"), + ("MXN", "Mexican Peso"), + ("MXP", "Mexican Silver Peso (1861–1992)"), + ("MDC", "Moldovan Cupon"), + ("MDL", "Moldovan Leu"), + ("MCF", "Monegasque Franc"), + ("MNT", "Mongolian Tugrik"), + ("MAD", "Moroccan Dirham"), + ("MAF", "Moroccan Franc"), + ("MZE", "Mozambican Escudo"), + ("MZN", "Mozambican Metical"), + ("MZM", "Mozambican Metical (1980–2006)"), + ("MMK", "Myanmar Kyat"), + ("NAD", "Namibian Dollar"), + ("NPR", "Nepalese Rupee"), + ("ANG", "Netherlands Antillean Guilder"), + ("TWD", "New Taiwan Dollar"), + ("NZD", "New Zealand Dollar"), + ("NIO", "Nicaraguan Córdoba"), + ("NIC", "Nicaraguan Córdoba (1988–1991)"), + ("NGN", "Nigerian Naira"), + ("KPW", "North Korean Won"), + ("NOK", "Norwegian Krone"), + ("OMR", "Omani Rial"), + ("PKR", "Pakistani Rupee"), + ("XPD", "Palladium"), + ("PAB", "Panamanian Balboa"), + ("PGK", "Papua New Guinean Kina"), + ("PYG", "Paraguayan Guarani"), + ("PEI", "Peruvian Inti"), + ("PEN", "Peruvian Sol"), + ("PES", "Peruvian Sol (1863–1965)"), + ("PHP", "Philippine Peso"), + ("XPT", "Platinum"), + ("PLN", "Polish Zloty"), + ("PLZ", "Polish Zloty (1950–1995)"), + ("PTE", "Portuguese Escudo"), + ("GWE", "Portuguese Guinea Escudo"), + ("QAR", "Qatari Riyal"), + ("XRE", "RINET Funds"), + ("RHD", "Rhodesian Dollar"), + ("RON", "Romanian Leu"), + ("ROL", "Romanian Leu (1952–2006)"), + ("RUB", "Russian Ruble"), + ("RUR", "Russian Ruble (1991–1998)"), + ("RWF", "Rwandan Franc"), + ("SVC", "Salvadoran Colón"), + ("WST", "Samoan Tala"), + ("SAR", "Saudi Riyal"), + ("RSD", "Serbian Dinar"), + ("CSD", "Serbian Dinar (2002–2006)"), + ("SCR", "Seychellois Rupee"), + ("SLL", "Sierra Leonean Leone (1964—2022)"), + ("XAG", "Silver"), + ("SGD", "Singapore Dollar"), + ("SKK", "Slovak Koruna"), + ("SIT", "Slovenian Tolar"), + ("SBD", "Solomon Islands Dollar"), + ("SOS", "Somali Shilling"), + ("ZAR", "South African Rand"), + ("ZAL", "South African Rand (financial)"), + ("KRH", "South Korean Hwan (1953–1962)"), + ("KRW", "South Korean Won"), + ("KRO", "South Korean Won (1945–1953)"), + ("SSP", "South Sudanese Pound"), + ("SUR", "Soviet Rouble"), + ("ESP", "Spanish Peseta"), + ("ESA", "Spanish Peseta (A account)"), + ("ESB", "Spanish Peseta (convertible account)"), + ("XDR", "Special Drawing Rights"), + ("LKR", "Sri Lankan Rupee"), + ("SHP", "St. Helena Pound"), + ("XSU", "Sucre"), + ("SDD", "Sudanese Dinar (1992–2007)"), + ("SDG", "Sudanese Pound"), + ("SDP", "Sudanese Pound (1957–1998)"), + ("SRD", "Surinamese Dollar"), + ("SRG", "Surinamese Guilder"), + ("SZL", "Swazi Lilangeni"), + ("SEK", "Swedish Krona"), + ("CHF", "Swiss Franc"), + ("SYP", "Syrian Pound"), + ("STN", "São Tomé & Príncipe Dobra"), + ("STD", "São Tomé & Príncipe Dobra (1977–2017)"), + ("TVD", "TVD"), + ("TJR", "Tajikistani Ruble"), + ("TJS", "Tajikistani Somoni"), + ("TZS", "Tanzanian Shilling"), + ("XTS", "Testing Currency Code"), + ("THB", "Thai Baht"), + ( + "XXX", + "The codes assigned for transactions where no currency is involved", + ), + ("TPE", "Timorese Escudo"), + ("TOP", "Tongan Paʻanga"), + ("TTD", "Trinidad & Tobago Dollar"), + ("TND", "Tunisian Dinar"), + ("TRY", "Turkish Lira"), + ("TRL", "Turkish Lira (1922–2005)"), + ("TMT", "Turkmenistani Manat"), + ("TMM", "Turkmenistani Manat (1993–2009)"), + ("USD", "US Dollar"), + ("USN", "US Dollar (Next day)"), + ("USS", "US Dollar (Same day)"), + ("UGX", "Ugandan Shilling"), + ("UGS", "Ugandan Shilling (1966–1987)"), + ("UAH", "Ukrainian Hryvnia"), + ("UAK", "Ukrainian Karbovanets"), + ("AED", "United Arab Emirates Dirham"), + ("UYW", "Uruguayan Nominal Wage Index Unit"), + ("UYU", "Uruguayan Peso"), + ("UYP", "Uruguayan Peso (1975–1993)"), + ("UYI", "Uruguayan Peso (Indexed Units)"), + ("UZS", "Uzbekistani Som"), + ("VUV", "Vanuatu Vatu"), + ("VES", "Venezuelan Bolívar"), + ("VEB", "Venezuelan Bolívar (1871–2008)"), + ("VEF", "Venezuelan Bolívar (2008–2018)"), + ("VND", "Vietnamese Dong"), + ("VNN", "Vietnamese Dong (1978–1985)"), + ("CHE", "WIR Euro"), + ("CHW", "WIR Franc"), + ("XOF", "West African CFA Franc"), + ("YDD", "Yemeni Dinar"), + ("YER", "Yemeni Rial"), + ("YUN", "Yugoslavian Convertible Dinar (1990–1992)"), + ("YUD", "Yugoslavian Hard Dinar (1966–1990)"), + ("YUM", "Yugoslavian New Dinar (1994–2002)"), + ("YUR", "Yugoslavian Reformed Dinar (1992–1993)"), + ("ZWN", "ZWN"), + ("ZRN", "Zairean New Zaire (1993–1998)"), + ("ZRZ", "Zairean Zaire (1971–1993)"), + ("ZMW", "Zambian Kwacha"), + ("ZMK", "Zambian Kwacha (1968–2012)"), + ("ZWD", "Zimbabwean Dollar (1980–2008)"), + ("ZWR", "Zimbabwean Dollar (2008)"), + ("ZWL", "Zimbabwean Dollar (2009)"), + ], + default="CHF", + editable=False, + max_length=3, + null=True, + ), + ), + migrations.AlterField( + model_name="order", + name="processing_fee_currency", + field=djmoney.models.fields.CurrencyField( + choices=[ + ("XUA", "ADB Unit of Account"), + ("AFN", "Afghan Afghani"), + ("AFA", "Afghan Afghani (1927–2002)"), + ("ALL", "Albanian Lek"), + ("ALK", "Albanian Lek (1946–1965)"), + ("DZD", "Algerian Dinar"), + ("ADP", "Andorran Peseta"), + ("AOA", "Angolan Kwanza"), + ("AOK", "Angolan Kwanza (1977–1991)"), + ("AON", "Angolan New Kwanza (1990–2000)"), + ("AOR", "Angolan Readjusted Kwanza (1995–1999)"), + ("ARA", "Argentine Austral"), + ("ARS", "Argentine Peso"), + ("ARM", "Argentine Peso (1881–1970)"), + ("ARP", "Argentine Peso (1983–1985)"), + ("ARL", "Argentine Peso Ley (1970–1983)"), + ("AMD", "Armenian Dram"), + ("AWG", "Aruban Florin"), + ("AUD", "Australian Dollar"), + ("ATS", "Austrian Schilling"), + ("AZN", "Azerbaijani Manat"), + ("AZM", "Azerbaijani Manat (1993–2006)"), + ("BSD", "Bahamian Dollar"), + ("BHD", "Bahraini Dinar"), + ("BDT", "Bangladeshi Taka"), + ("BBD", "Barbadian Dollar"), + ("BYN", "Belarusian Ruble"), + ("BYB", "Belarusian Ruble (1994–1999)"), + ("BYR", "Belarusian Ruble (2000–2016)"), + ("BEF", "Belgian Franc"), + ("BEC", "Belgian Franc (convertible)"), + ("BEL", "Belgian Franc (financial)"), + ("BZD", "Belize Dollar"), + ("BMD", "Bermudan Dollar"), + ("BTN", "Bhutanese Ngultrum"), + ("BOB", "Bolivian Boliviano"), + ("BOL", "Bolivian Boliviano (1863–1963)"), + ("BOV", "Bolivian Mvdol"), + ("BOP", "Bolivian Peso"), + ("BAM", "Bosnia-Herzegovina Convertible Mark"), + ("BAD", "Bosnia-Herzegovina Dinar (1992–1994)"), + ("BAN", "Bosnia-Herzegovina New Dinar (1994–1997)"), + ("BWP", "Botswanan Pula"), + ("BRC", "Brazilian Cruzado (1986–1989)"), + ("BRZ", "Brazilian Cruzeiro (1942–1967)"), + ("BRE", "Brazilian Cruzeiro (1990–1993)"), + ("BRR", "Brazilian Cruzeiro (1993–1994)"), + ("BRN", "Brazilian New Cruzado (1989–1990)"), + ("BRB", "Brazilian New Cruzeiro (1967–1986)"), + ("BRL", "Brazilian Real"), + ("GBP", "British Pound"), + ("BND", "Brunei Dollar"), + ("BGL", "Bulgarian Hard Lev"), + ("BGN", "Bulgarian Lev"), + ("BGO", "Bulgarian Lev (1879–1952)"), + ("BGM", "Bulgarian Socialist Lev"), + ("BUK", "Burmese Kyat"), + ("BIF", "Burundian Franc"), + ("XPF", "CFP Franc"), + ("KHR", "Cambodian Riel"), + ("CAD", "Canadian Dollar"), + ("CVE", "Cape Verdean Escudo"), + ("KYD", "Cayman Islands Dollar"), + ("XAF", "Central African CFA Franc"), + ("CLE", "Chilean Escudo"), + ("CLP", "Chilean Peso"), + ("CLF", "Chilean Unit of Account (UF)"), + ("CNX", "Chinese People’s Bank Dollar"), + ("CNY", "Chinese Yuan"), + ("CNH", "Chinese Yuan (offshore)"), + ("COP", "Colombian Peso"), + ("COU", "Colombian Real Value Unit"), + ("KMF", "Comorian Franc"), + ("CDF", "Congolese Franc"), + ("CRC", "Costa Rican Colón"), + ("HRD", "Croatian Dinar"), + ("HRK", "Croatian Kuna"), + ("CUC", "Cuban Convertible Peso"), + ("CUP", "Cuban Peso"), + ("CYP", "Cypriot Pound"), + ("CZK", "Czech Koruna"), + ("CSK", "Czechoslovak Hard Koruna"), + ("DKK", "Danish Krone"), + ("DJF", "Djiboutian Franc"), + ("DOP", "Dominican Peso"), + ("NLG", "Dutch Guilder"), + ("XCD", "East Caribbean Dollar"), + ("DDM", "East German Mark"), + ("ECS", "Ecuadorian Sucre"), + ("ECV", "Ecuadorian Unit of Constant Value"), + ("EGP", "Egyptian Pound"), + ("GQE", "Equatorial Guinean Ekwele"), + ("ERN", "Eritrean Nakfa"), + ("EEK", "Estonian Kroon"), + ("ETB", "Ethiopian Birr"), + ("EUR", "Euro"), + ("XBA", "European Composite Unit"), + ("XEU", "European Currency Unit"), + ("XBB", "European Monetary Unit"), + ("XBC", "European Unit of Account (XBC)"), + ("XBD", "European Unit of Account (XBD)"), + ("FKP", "Falkland Islands Pound"), + ("FJD", "Fijian Dollar"), + ("FIM", "Finnish Markka"), + ("FRF", "French Franc"), + ("XFO", "French Gold Franc"), + ("XFU", "French UIC-Franc"), + ("GMD", "Gambian Dalasi"), + ("GEK", "Georgian Kupon Larit"), + ("GEL", "Georgian Lari"), + ("DEM", "German Mark"), + ("GHS", "Ghanaian Cedi"), + ("GHC", "Ghanaian Cedi (1979–2007)"), + ("GIP", "Gibraltar Pound"), + ("XAU", "Gold"), + ("GRD", "Greek Drachma"), + ("GTQ", "Guatemalan Quetzal"), + ("GWP", "Guinea-Bissau Peso"), + ("GNF", "Guinean Franc"), + ("GNS", "Guinean Syli"), + ("GYD", "Guyanaese Dollar"), + ("HTG", "Haitian Gourde"), + ("HNL", "Honduran Lempira"), + ("HKD", "Hong Kong Dollar"), + ("HUF", "Hungarian Forint"), + ("IMP", "IMP"), + ("ISK", "Icelandic Króna"), + ("ISJ", "Icelandic Króna (1918–1981)"), + ("INR", "Indian Rupee"), + ("IDR", "Indonesian Rupiah"), + ("IRR", "Iranian Rial"), + ("IQD", "Iraqi Dinar"), + ("IEP", "Irish Pound"), + ("ILS", "Israeli New Shekel"), + ("ILP", "Israeli Pound"), + ("ILR", "Israeli Shekel (1980–1985)"), + ("ITL", "Italian Lira"), + ("JMD", "Jamaican Dollar"), + ("JPY", "Japanese Yen"), + ("JOD", "Jordanian Dinar"), + ("KZT", "Kazakhstani Tenge"), + ("KES", "Kenyan Shilling"), + ("KWD", "Kuwaiti Dinar"), + ("KGS", "Kyrgystani Som"), + ("LAK", "Laotian Kip"), + ("LVL", "Latvian Lats"), + ("LVR", "Latvian Ruble"), + ("LBP", "Lebanese Pound"), + ("LSL", "Lesotho Loti"), + ("LRD", "Liberian Dollar"), + ("LYD", "Libyan Dinar"), + ("LTL", "Lithuanian Litas"), + ("LTT", "Lithuanian Talonas"), + ("LUL", "Luxembourg Financial Franc"), + ("LUC", "Luxembourgian Convertible Franc"), + ("LUF", "Luxembourgian Franc"), + ("MOP", "Macanese Pataca"), + ("MKD", "Macedonian Denar"), + ("MKN", "Macedonian Denar (1992–1993)"), + ("MGA", "Malagasy Ariary"), + ("MGF", "Malagasy Franc"), + ("MWK", "Malawian Kwacha"), + ("MYR", "Malaysian Ringgit"), + ("MVR", "Maldivian Rufiyaa"), + ("MVP", "Maldivian Rupee (1947–1981)"), + ("MLF", "Malian Franc"), + ("MTL", "Maltese Lira"), + ("MTP", "Maltese Pound"), + ("MRU", "Mauritanian Ouguiya"), + ("MRO", "Mauritanian Ouguiya (1973–2017)"), + ("MUR", "Mauritian Rupee"), + ("MXV", "Mexican Investment Unit"), + ("MXN", "Mexican Peso"), + ("MXP", "Mexican Silver Peso (1861–1992)"), + ("MDC", "Moldovan Cupon"), + ("MDL", "Moldovan Leu"), + ("MCF", "Monegasque Franc"), + ("MNT", "Mongolian Tugrik"), + ("MAD", "Moroccan Dirham"), + ("MAF", "Moroccan Franc"), + ("MZE", "Mozambican Escudo"), + ("MZN", "Mozambican Metical"), + ("MZM", "Mozambican Metical (1980–2006)"), + ("MMK", "Myanmar Kyat"), + ("NAD", "Namibian Dollar"), + ("NPR", "Nepalese Rupee"), + ("ANG", "Netherlands Antillean Guilder"), + ("TWD", "New Taiwan Dollar"), + ("NZD", "New Zealand Dollar"), + ("NIO", "Nicaraguan Córdoba"), + ("NIC", "Nicaraguan Córdoba (1988–1991)"), + ("NGN", "Nigerian Naira"), + ("KPW", "North Korean Won"), + ("NOK", "Norwegian Krone"), + ("OMR", "Omani Rial"), + ("PKR", "Pakistani Rupee"), + ("XPD", "Palladium"), + ("PAB", "Panamanian Balboa"), + ("PGK", "Papua New Guinean Kina"), + ("PYG", "Paraguayan Guarani"), + ("PEI", "Peruvian Inti"), + ("PEN", "Peruvian Sol"), + ("PES", "Peruvian Sol (1863–1965)"), + ("PHP", "Philippine Peso"), + ("XPT", "Platinum"), + ("PLN", "Polish Zloty"), + ("PLZ", "Polish Zloty (1950–1995)"), + ("PTE", "Portuguese Escudo"), + ("GWE", "Portuguese Guinea Escudo"), + ("QAR", "Qatari Riyal"), + ("XRE", "RINET Funds"), + ("RHD", "Rhodesian Dollar"), + ("RON", "Romanian Leu"), + ("ROL", "Romanian Leu (1952–2006)"), + ("RUB", "Russian Ruble"), + ("RUR", "Russian Ruble (1991–1998)"), + ("RWF", "Rwandan Franc"), + ("SVC", "Salvadoran Colón"), + ("WST", "Samoan Tala"), + ("SAR", "Saudi Riyal"), + ("RSD", "Serbian Dinar"), + ("CSD", "Serbian Dinar (2002–2006)"), + ("SCR", "Seychellois Rupee"), + ("SLL", "Sierra Leonean Leone (1964—2022)"), + ("XAG", "Silver"), + ("SGD", "Singapore Dollar"), + ("SKK", "Slovak Koruna"), + ("SIT", "Slovenian Tolar"), + ("SBD", "Solomon Islands Dollar"), + ("SOS", "Somali Shilling"), + ("ZAR", "South African Rand"), + ("ZAL", "South African Rand (financial)"), + ("KRH", "South Korean Hwan (1953–1962)"), + ("KRW", "South Korean Won"), + ("KRO", "South Korean Won (1945–1953)"), + ("SSP", "South Sudanese Pound"), + ("SUR", "Soviet Rouble"), + ("ESP", "Spanish Peseta"), + ("ESA", "Spanish Peseta (A account)"), + ("ESB", "Spanish Peseta (convertible account)"), + ("XDR", "Special Drawing Rights"), + ("LKR", "Sri Lankan Rupee"), + ("SHP", "St. Helena Pound"), + ("XSU", "Sucre"), + ("SDD", "Sudanese Dinar (1992–2007)"), + ("SDG", "Sudanese Pound"), + ("SDP", "Sudanese Pound (1957–1998)"), + ("SRD", "Surinamese Dollar"), + ("SRG", "Surinamese Guilder"), + ("SZL", "Swazi Lilangeni"), + ("SEK", "Swedish Krona"), + ("CHF", "Swiss Franc"), + ("SYP", "Syrian Pound"), + ("STN", "São Tomé & Príncipe Dobra"), + ("STD", "São Tomé & Príncipe Dobra (1977–2017)"), + ("TVD", "TVD"), + ("TJR", "Tajikistani Ruble"), + ("TJS", "Tajikistani Somoni"), + ("TZS", "Tanzanian Shilling"), + ("XTS", "Testing Currency Code"), + ("THB", "Thai Baht"), + ( + "XXX", + "The codes assigned for transactions where no currency is involved", + ), + ("TPE", "Timorese Escudo"), + ("TOP", "Tongan Paʻanga"), + ("TTD", "Trinidad & Tobago Dollar"), + ("TND", "Tunisian Dinar"), + ("TRY", "Turkish Lira"), + ("TRL", "Turkish Lira (1922–2005)"), + ("TMT", "Turkmenistani Manat"), + ("TMM", "Turkmenistani Manat (1993–2009)"), + ("USD", "US Dollar"), + ("USN", "US Dollar (Next day)"), + ("USS", "US Dollar (Same day)"), + ("UGX", "Ugandan Shilling"), + ("UGS", "Ugandan Shilling (1966–1987)"), + ("UAH", "Ukrainian Hryvnia"), + ("UAK", "Ukrainian Karbovanets"), + ("AED", "United Arab Emirates Dirham"), + ("UYW", "Uruguayan Nominal Wage Index Unit"), + ("UYU", "Uruguayan Peso"), + ("UYP", "Uruguayan Peso (1975–1993)"), + ("UYI", "Uruguayan Peso (Indexed Units)"), + ("UZS", "Uzbekistani Som"), + ("VUV", "Vanuatu Vatu"), + ("VES", "Venezuelan Bolívar"), + ("VEB", "Venezuelan Bolívar (1871–2008)"), + ("VEF", "Venezuelan Bolívar (2008–2018)"), + ("VND", "Vietnamese Dong"), + ("VNN", "Vietnamese Dong (1978–1985)"), + ("CHE", "WIR Euro"), + ("CHW", "WIR Franc"), + ("XOF", "West African CFA Franc"), + ("YDD", "Yemeni Dinar"), + ("YER", "Yemeni Rial"), + ("YUN", "Yugoslavian Convertible Dinar (1990–1992)"), + ("YUD", "Yugoslavian Hard Dinar (1966–1990)"), + ("YUM", "Yugoslavian New Dinar (1994–2002)"), + ("YUR", "Yugoslavian Reformed Dinar (1992–1993)"), + ("ZWN", "ZWN"), + ("ZRN", "Zairean New Zaire (1993–1998)"), + ("ZRZ", "Zairean Zaire (1971–1993)"), + ("ZMW", "Zambian Kwacha"), + ("ZMK", "Zambian Kwacha (1968–2012)"), + ("ZWD", "Zimbabwean Dollar (1980–2008)"), + ("ZWR", "Zimbabwean Dollar (2008)"), + ("ZWL", "Zimbabwean Dollar (2009)"), + ], + default="CHF", + editable=False, + max_length=3, + null=True, + ), + ), + migrations.AlterField( + model_name="order", + name="total_with_vat_currency", + field=djmoney.models.fields.CurrencyField( + choices=[ + ("XUA", "ADB Unit of Account"), + ("AFN", "Afghan Afghani"), + ("AFA", "Afghan Afghani (1927–2002)"), + ("ALL", "Albanian Lek"), + ("ALK", "Albanian Lek (1946–1965)"), + ("DZD", "Algerian Dinar"), + ("ADP", "Andorran Peseta"), + ("AOA", "Angolan Kwanza"), + ("AOK", "Angolan Kwanza (1977–1991)"), + ("AON", "Angolan New Kwanza (1990–2000)"), + ("AOR", "Angolan Readjusted Kwanza (1995–1999)"), + ("ARA", "Argentine Austral"), + ("ARS", "Argentine Peso"), + ("ARM", "Argentine Peso (1881–1970)"), + ("ARP", "Argentine Peso (1983–1985)"), + ("ARL", "Argentine Peso Ley (1970–1983)"), + ("AMD", "Armenian Dram"), + ("AWG", "Aruban Florin"), + ("AUD", "Australian Dollar"), + ("ATS", "Austrian Schilling"), + ("AZN", "Azerbaijani Manat"), + ("AZM", "Azerbaijani Manat (1993–2006)"), + ("BSD", "Bahamian Dollar"), + ("BHD", "Bahraini Dinar"), + ("BDT", "Bangladeshi Taka"), + ("BBD", "Barbadian Dollar"), + ("BYN", "Belarusian Ruble"), + ("BYB", "Belarusian Ruble (1994–1999)"), + ("BYR", "Belarusian Ruble (2000–2016)"), + ("BEF", "Belgian Franc"), + ("BEC", "Belgian Franc (convertible)"), + ("BEL", "Belgian Franc (financial)"), + ("BZD", "Belize Dollar"), + ("BMD", "Bermudan Dollar"), + ("BTN", "Bhutanese Ngultrum"), + ("BOB", "Bolivian Boliviano"), + ("BOL", "Bolivian Boliviano (1863–1963)"), + ("BOV", "Bolivian Mvdol"), + ("BOP", "Bolivian Peso"), + ("BAM", "Bosnia-Herzegovina Convertible Mark"), + ("BAD", "Bosnia-Herzegovina Dinar (1992–1994)"), + ("BAN", "Bosnia-Herzegovina New Dinar (1994–1997)"), + ("BWP", "Botswanan Pula"), + ("BRC", "Brazilian Cruzado (1986–1989)"), + ("BRZ", "Brazilian Cruzeiro (1942–1967)"), + ("BRE", "Brazilian Cruzeiro (1990–1993)"), + ("BRR", "Brazilian Cruzeiro (1993–1994)"), + ("BRN", "Brazilian New Cruzado (1989–1990)"), + ("BRB", "Brazilian New Cruzeiro (1967–1986)"), + ("BRL", "Brazilian Real"), + ("GBP", "British Pound"), + ("BND", "Brunei Dollar"), + ("BGL", "Bulgarian Hard Lev"), + ("BGN", "Bulgarian Lev"), + ("BGO", "Bulgarian Lev (1879–1952)"), + ("BGM", "Bulgarian Socialist Lev"), + ("BUK", "Burmese Kyat"), + ("BIF", "Burundian Franc"), + ("XPF", "CFP Franc"), + ("KHR", "Cambodian Riel"), + ("CAD", "Canadian Dollar"), + ("CVE", "Cape Verdean Escudo"), + ("KYD", "Cayman Islands Dollar"), + ("XAF", "Central African CFA Franc"), + ("CLE", "Chilean Escudo"), + ("CLP", "Chilean Peso"), + ("CLF", "Chilean Unit of Account (UF)"), + ("CNX", "Chinese People’s Bank Dollar"), + ("CNY", "Chinese Yuan"), + ("CNH", "Chinese Yuan (offshore)"), + ("COP", "Colombian Peso"), + ("COU", "Colombian Real Value Unit"), + ("KMF", "Comorian Franc"), + ("CDF", "Congolese Franc"), + ("CRC", "Costa Rican Colón"), + ("HRD", "Croatian Dinar"), + ("HRK", "Croatian Kuna"), + ("CUC", "Cuban Convertible Peso"), + ("CUP", "Cuban Peso"), + ("CYP", "Cypriot Pound"), + ("CZK", "Czech Koruna"), + ("CSK", "Czechoslovak Hard Koruna"), + ("DKK", "Danish Krone"), + ("DJF", "Djiboutian Franc"), + ("DOP", "Dominican Peso"), + ("NLG", "Dutch Guilder"), + ("XCD", "East Caribbean Dollar"), + ("DDM", "East German Mark"), + ("ECS", "Ecuadorian Sucre"), + ("ECV", "Ecuadorian Unit of Constant Value"), + ("EGP", "Egyptian Pound"), + ("GQE", "Equatorial Guinean Ekwele"), + ("ERN", "Eritrean Nakfa"), + ("EEK", "Estonian Kroon"), + ("ETB", "Ethiopian Birr"), + ("EUR", "Euro"), + ("XBA", "European Composite Unit"), + ("XEU", "European Currency Unit"), + ("XBB", "European Monetary Unit"), + ("XBC", "European Unit of Account (XBC)"), + ("XBD", "European Unit of Account (XBD)"), + ("FKP", "Falkland Islands Pound"), + ("FJD", "Fijian Dollar"), + ("FIM", "Finnish Markka"), + ("FRF", "French Franc"), + ("XFO", "French Gold Franc"), + ("XFU", "French UIC-Franc"), + ("GMD", "Gambian Dalasi"), + ("GEK", "Georgian Kupon Larit"), + ("GEL", "Georgian Lari"), + ("DEM", "German Mark"), + ("GHS", "Ghanaian Cedi"), + ("GHC", "Ghanaian Cedi (1979–2007)"), + ("GIP", "Gibraltar Pound"), + ("XAU", "Gold"), + ("GRD", "Greek Drachma"), + ("GTQ", "Guatemalan Quetzal"), + ("GWP", "Guinea-Bissau Peso"), + ("GNF", "Guinean Franc"), + ("GNS", "Guinean Syli"), + ("GYD", "Guyanaese Dollar"), + ("HTG", "Haitian Gourde"), + ("HNL", "Honduran Lempira"), + ("HKD", "Hong Kong Dollar"), + ("HUF", "Hungarian Forint"), + ("IMP", "IMP"), + ("ISK", "Icelandic Króna"), + ("ISJ", "Icelandic Króna (1918–1981)"), + ("INR", "Indian Rupee"), + ("IDR", "Indonesian Rupiah"), + ("IRR", "Iranian Rial"), + ("IQD", "Iraqi Dinar"), + ("IEP", "Irish Pound"), + ("ILS", "Israeli New Shekel"), + ("ILP", "Israeli Pound"), + ("ILR", "Israeli Shekel (1980–1985)"), + ("ITL", "Italian Lira"), + ("JMD", "Jamaican Dollar"), + ("JPY", "Japanese Yen"), + ("JOD", "Jordanian Dinar"), + ("KZT", "Kazakhstani Tenge"), + ("KES", "Kenyan Shilling"), + ("KWD", "Kuwaiti Dinar"), + ("KGS", "Kyrgystani Som"), + ("LAK", "Laotian Kip"), + ("LVL", "Latvian Lats"), + ("LVR", "Latvian Ruble"), + ("LBP", "Lebanese Pound"), + ("LSL", "Lesotho Loti"), + ("LRD", "Liberian Dollar"), + ("LYD", "Libyan Dinar"), + ("LTL", "Lithuanian Litas"), + ("LTT", "Lithuanian Talonas"), + ("LUL", "Luxembourg Financial Franc"), + ("LUC", "Luxembourgian Convertible Franc"), + ("LUF", "Luxembourgian Franc"), + ("MOP", "Macanese Pataca"), + ("MKD", "Macedonian Denar"), + ("MKN", "Macedonian Denar (1992–1993)"), + ("MGA", "Malagasy Ariary"), + ("MGF", "Malagasy Franc"), + ("MWK", "Malawian Kwacha"), + ("MYR", "Malaysian Ringgit"), + ("MVR", "Maldivian Rufiyaa"), + ("MVP", "Maldivian Rupee (1947–1981)"), + ("MLF", "Malian Franc"), + ("MTL", "Maltese Lira"), + ("MTP", "Maltese Pound"), + ("MRU", "Mauritanian Ouguiya"), + ("MRO", "Mauritanian Ouguiya (1973–2017)"), + ("MUR", "Mauritian Rupee"), + ("MXV", "Mexican Investment Unit"), + ("MXN", "Mexican Peso"), + ("MXP", "Mexican Silver Peso (1861–1992)"), + ("MDC", "Moldovan Cupon"), + ("MDL", "Moldovan Leu"), + ("MCF", "Monegasque Franc"), + ("MNT", "Mongolian Tugrik"), + ("MAD", "Moroccan Dirham"), + ("MAF", "Moroccan Franc"), + ("MZE", "Mozambican Escudo"), + ("MZN", "Mozambican Metical"), + ("MZM", "Mozambican Metical (1980–2006)"), + ("MMK", "Myanmar Kyat"), + ("NAD", "Namibian Dollar"), + ("NPR", "Nepalese Rupee"), + ("ANG", "Netherlands Antillean Guilder"), + ("TWD", "New Taiwan Dollar"), + ("NZD", "New Zealand Dollar"), + ("NIO", "Nicaraguan Córdoba"), + ("NIC", "Nicaraguan Córdoba (1988–1991)"), + ("NGN", "Nigerian Naira"), + ("KPW", "North Korean Won"), + ("NOK", "Norwegian Krone"), + ("OMR", "Omani Rial"), + ("PKR", "Pakistani Rupee"), + ("XPD", "Palladium"), + ("PAB", "Panamanian Balboa"), + ("PGK", "Papua New Guinean Kina"), + ("PYG", "Paraguayan Guarani"), + ("PEI", "Peruvian Inti"), + ("PEN", "Peruvian Sol"), + ("PES", "Peruvian Sol (1863–1965)"), + ("PHP", "Philippine Peso"), + ("XPT", "Platinum"), + ("PLN", "Polish Zloty"), + ("PLZ", "Polish Zloty (1950–1995)"), + ("PTE", "Portuguese Escudo"), + ("GWE", "Portuguese Guinea Escudo"), + ("QAR", "Qatari Riyal"), + ("XRE", "RINET Funds"), + ("RHD", "Rhodesian Dollar"), + ("RON", "Romanian Leu"), + ("ROL", "Romanian Leu (1952–2006)"), + ("RUB", "Russian Ruble"), + ("RUR", "Russian Ruble (1991–1998)"), + ("RWF", "Rwandan Franc"), + ("SVC", "Salvadoran Colón"), + ("WST", "Samoan Tala"), + ("SAR", "Saudi Riyal"), + ("RSD", "Serbian Dinar"), + ("CSD", "Serbian Dinar (2002–2006)"), + ("SCR", "Seychellois Rupee"), + ("SLL", "Sierra Leonean Leone (1964—2022)"), + ("XAG", "Silver"), + ("SGD", "Singapore Dollar"), + ("SKK", "Slovak Koruna"), + ("SIT", "Slovenian Tolar"), + ("SBD", "Solomon Islands Dollar"), + ("SOS", "Somali Shilling"), + ("ZAR", "South African Rand"), + ("ZAL", "South African Rand (financial)"), + ("KRH", "South Korean Hwan (1953–1962)"), + ("KRW", "South Korean Won"), + ("KRO", "South Korean Won (1945–1953)"), + ("SSP", "South Sudanese Pound"), + ("SUR", "Soviet Rouble"), + ("ESP", "Spanish Peseta"), + ("ESA", "Spanish Peseta (A account)"), + ("ESB", "Spanish Peseta (convertible account)"), + ("XDR", "Special Drawing Rights"), + ("LKR", "Sri Lankan Rupee"), + ("SHP", "St. Helena Pound"), + ("XSU", "Sucre"), + ("SDD", "Sudanese Dinar (1992–2007)"), + ("SDG", "Sudanese Pound"), + ("SDP", "Sudanese Pound (1957–1998)"), + ("SRD", "Surinamese Dollar"), + ("SRG", "Surinamese Guilder"), + ("SZL", "Swazi Lilangeni"), + ("SEK", "Swedish Krona"), + ("CHF", "Swiss Franc"), + ("SYP", "Syrian Pound"), + ("STN", "São Tomé & Príncipe Dobra"), + ("STD", "São Tomé & Príncipe Dobra (1977–2017)"), + ("TVD", "TVD"), + ("TJR", "Tajikistani Ruble"), + ("TJS", "Tajikistani Somoni"), + ("TZS", "Tanzanian Shilling"), + ("XTS", "Testing Currency Code"), + ("THB", "Thai Baht"), + ( + "XXX", + "The codes assigned for transactions where no currency is involved", + ), + ("TPE", "Timorese Escudo"), + ("TOP", "Tongan Paʻanga"), + ("TTD", "Trinidad & Tobago Dollar"), + ("TND", "Tunisian Dinar"), + ("TRY", "Turkish Lira"), + ("TRL", "Turkish Lira (1922–2005)"), + ("TMT", "Turkmenistani Manat"), + ("TMM", "Turkmenistani Manat (1993–2009)"), + ("USD", "US Dollar"), + ("USN", "US Dollar (Next day)"), + ("USS", "US Dollar (Same day)"), + ("UGX", "Ugandan Shilling"), + ("UGS", "Ugandan Shilling (1966–1987)"), + ("UAH", "Ukrainian Hryvnia"), + ("UAK", "Ukrainian Karbovanets"), + ("AED", "United Arab Emirates Dirham"), + ("UYW", "Uruguayan Nominal Wage Index Unit"), + ("UYU", "Uruguayan Peso"), + ("UYP", "Uruguayan Peso (1975–1993)"), + ("UYI", "Uruguayan Peso (Indexed Units)"), + ("UZS", "Uzbekistani Som"), + ("VUV", "Vanuatu Vatu"), + ("VES", "Venezuelan Bolívar"), + ("VEB", "Venezuelan Bolívar (1871–2008)"), + ("VEF", "Venezuelan Bolívar (2008–2018)"), + ("VND", "Vietnamese Dong"), + ("VNN", "Vietnamese Dong (1978–1985)"), + ("CHE", "WIR Euro"), + ("CHW", "WIR Franc"), + ("XOF", "West African CFA Franc"), + ("YDD", "Yemeni Dinar"), + ("YER", "Yemeni Rial"), + ("YUN", "Yugoslavian Convertible Dinar (1990–1992)"), + ("YUD", "Yugoslavian Hard Dinar (1966–1990)"), + ("YUM", "Yugoslavian New Dinar (1994–2002)"), + ("YUR", "Yugoslavian Reformed Dinar (1992–1993)"), + ("ZWN", "ZWN"), + ("ZRN", "Zairean New Zaire (1993–1998)"), + ("ZRZ", "Zairean Zaire (1971–1993)"), + ("ZMW", "Zambian Kwacha"), + ("ZMK", "Zambian Kwacha (1968–2012)"), + ("ZWD", "Zimbabwean Dollar (1980–2008)"), + ("ZWR", "Zimbabwean Dollar (2008)"), + ("ZWL", "Zimbabwean Dollar (2009)"), + ], + default="CHF", + editable=False, + max_length=3, + null=True, + ), + ), + migrations.AlterField( + model_name="order", + name="total_without_vat_currency", + field=djmoney.models.fields.CurrencyField( + choices=[ + ("XUA", "ADB Unit of Account"), + ("AFN", "Afghan Afghani"), + ("AFA", "Afghan Afghani (1927–2002)"), + ("ALL", "Albanian Lek"), + ("ALK", "Albanian Lek (1946–1965)"), + ("DZD", "Algerian Dinar"), + ("ADP", "Andorran Peseta"), + ("AOA", "Angolan Kwanza"), + ("AOK", "Angolan Kwanza (1977–1991)"), + ("AON", "Angolan New Kwanza (1990–2000)"), + ("AOR", "Angolan Readjusted Kwanza (1995–1999)"), + ("ARA", "Argentine Austral"), + ("ARS", "Argentine Peso"), + ("ARM", "Argentine Peso (1881–1970)"), + ("ARP", "Argentine Peso (1983–1985)"), + ("ARL", "Argentine Peso Ley (1970–1983)"), + ("AMD", "Armenian Dram"), + ("AWG", "Aruban Florin"), + ("AUD", "Australian Dollar"), + ("ATS", "Austrian Schilling"), + ("AZN", "Azerbaijani Manat"), + ("AZM", "Azerbaijani Manat (1993–2006)"), + ("BSD", "Bahamian Dollar"), + ("BHD", "Bahraini Dinar"), + ("BDT", "Bangladeshi Taka"), + ("BBD", "Barbadian Dollar"), + ("BYN", "Belarusian Ruble"), + ("BYB", "Belarusian Ruble (1994–1999)"), + ("BYR", "Belarusian Ruble (2000–2016)"), + ("BEF", "Belgian Franc"), + ("BEC", "Belgian Franc (convertible)"), + ("BEL", "Belgian Franc (financial)"), + ("BZD", "Belize Dollar"), + ("BMD", "Bermudan Dollar"), + ("BTN", "Bhutanese Ngultrum"), + ("BOB", "Bolivian Boliviano"), + ("BOL", "Bolivian Boliviano (1863–1963)"), + ("BOV", "Bolivian Mvdol"), + ("BOP", "Bolivian Peso"), + ("BAM", "Bosnia-Herzegovina Convertible Mark"), + ("BAD", "Bosnia-Herzegovina Dinar (1992–1994)"), + ("BAN", "Bosnia-Herzegovina New Dinar (1994–1997)"), + ("BWP", "Botswanan Pula"), + ("BRC", "Brazilian Cruzado (1986–1989)"), + ("BRZ", "Brazilian Cruzeiro (1942–1967)"), + ("BRE", "Brazilian Cruzeiro (1990–1993)"), + ("BRR", "Brazilian Cruzeiro (1993–1994)"), + ("BRN", "Brazilian New Cruzado (1989–1990)"), + ("BRB", "Brazilian New Cruzeiro (1967–1986)"), + ("BRL", "Brazilian Real"), + ("GBP", "British Pound"), + ("BND", "Brunei Dollar"), + ("BGL", "Bulgarian Hard Lev"), + ("BGN", "Bulgarian Lev"), + ("BGO", "Bulgarian Lev (1879–1952)"), + ("BGM", "Bulgarian Socialist Lev"), + ("BUK", "Burmese Kyat"), + ("BIF", "Burundian Franc"), + ("XPF", "CFP Franc"), + ("KHR", "Cambodian Riel"), + ("CAD", "Canadian Dollar"), + ("CVE", "Cape Verdean Escudo"), + ("KYD", "Cayman Islands Dollar"), + ("XAF", "Central African CFA Franc"), + ("CLE", "Chilean Escudo"), + ("CLP", "Chilean Peso"), + ("CLF", "Chilean Unit of Account (UF)"), + ("CNX", "Chinese People’s Bank Dollar"), + ("CNY", "Chinese Yuan"), + ("CNH", "Chinese Yuan (offshore)"), + ("COP", "Colombian Peso"), + ("COU", "Colombian Real Value Unit"), + ("KMF", "Comorian Franc"), + ("CDF", "Congolese Franc"), + ("CRC", "Costa Rican Colón"), + ("HRD", "Croatian Dinar"), + ("HRK", "Croatian Kuna"), + ("CUC", "Cuban Convertible Peso"), + ("CUP", "Cuban Peso"), + ("CYP", "Cypriot Pound"), + ("CZK", "Czech Koruna"), + ("CSK", "Czechoslovak Hard Koruna"), + ("DKK", "Danish Krone"), + ("DJF", "Djiboutian Franc"), + ("DOP", "Dominican Peso"), + ("NLG", "Dutch Guilder"), + ("XCD", "East Caribbean Dollar"), + ("DDM", "East German Mark"), + ("ECS", "Ecuadorian Sucre"), + ("ECV", "Ecuadorian Unit of Constant Value"), + ("EGP", "Egyptian Pound"), + ("GQE", "Equatorial Guinean Ekwele"), + ("ERN", "Eritrean Nakfa"), + ("EEK", "Estonian Kroon"), + ("ETB", "Ethiopian Birr"), + ("EUR", "Euro"), + ("XBA", "European Composite Unit"), + ("XEU", "European Currency Unit"), + ("XBB", "European Monetary Unit"), + ("XBC", "European Unit of Account (XBC)"), + ("XBD", "European Unit of Account (XBD)"), + ("FKP", "Falkland Islands Pound"), + ("FJD", "Fijian Dollar"), + ("FIM", "Finnish Markka"), + ("FRF", "French Franc"), + ("XFO", "French Gold Franc"), + ("XFU", "French UIC-Franc"), + ("GMD", "Gambian Dalasi"), + ("GEK", "Georgian Kupon Larit"), + ("GEL", "Georgian Lari"), + ("DEM", "German Mark"), + ("GHS", "Ghanaian Cedi"), + ("GHC", "Ghanaian Cedi (1979–2007)"), + ("GIP", "Gibraltar Pound"), + ("XAU", "Gold"), + ("GRD", "Greek Drachma"), + ("GTQ", "Guatemalan Quetzal"), + ("GWP", "Guinea-Bissau Peso"), + ("GNF", "Guinean Franc"), + ("GNS", "Guinean Syli"), + ("GYD", "Guyanaese Dollar"), + ("HTG", "Haitian Gourde"), + ("HNL", "Honduran Lempira"), + ("HKD", "Hong Kong Dollar"), + ("HUF", "Hungarian Forint"), + ("IMP", "IMP"), + ("ISK", "Icelandic Króna"), + ("ISJ", "Icelandic Króna (1918–1981)"), + ("INR", "Indian Rupee"), + ("IDR", "Indonesian Rupiah"), + ("IRR", "Iranian Rial"), + ("IQD", "Iraqi Dinar"), + ("IEP", "Irish Pound"), + ("ILS", "Israeli New Shekel"), + ("ILP", "Israeli Pound"), + ("ILR", "Israeli Shekel (1980–1985)"), + ("ITL", "Italian Lira"), + ("JMD", "Jamaican Dollar"), + ("JPY", "Japanese Yen"), + ("JOD", "Jordanian Dinar"), + ("KZT", "Kazakhstani Tenge"), + ("KES", "Kenyan Shilling"), + ("KWD", "Kuwaiti Dinar"), + ("KGS", "Kyrgystani Som"), + ("LAK", "Laotian Kip"), + ("LVL", "Latvian Lats"), + ("LVR", "Latvian Ruble"), + ("LBP", "Lebanese Pound"), + ("LSL", "Lesotho Loti"), + ("LRD", "Liberian Dollar"), + ("LYD", "Libyan Dinar"), + ("LTL", "Lithuanian Litas"), + ("LTT", "Lithuanian Talonas"), + ("LUL", "Luxembourg Financial Franc"), + ("LUC", "Luxembourgian Convertible Franc"), + ("LUF", "Luxembourgian Franc"), + ("MOP", "Macanese Pataca"), + ("MKD", "Macedonian Denar"), + ("MKN", "Macedonian Denar (1992–1993)"), + ("MGA", "Malagasy Ariary"), + ("MGF", "Malagasy Franc"), + ("MWK", "Malawian Kwacha"), + ("MYR", "Malaysian Ringgit"), + ("MVR", "Maldivian Rufiyaa"), + ("MVP", "Maldivian Rupee (1947–1981)"), + ("MLF", "Malian Franc"), + ("MTL", "Maltese Lira"), + ("MTP", "Maltese Pound"), + ("MRU", "Mauritanian Ouguiya"), + ("MRO", "Mauritanian Ouguiya (1973–2017)"), + ("MUR", "Mauritian Rupee"), + ("MXV", "Mexican Investment Unit"), + ("MXN", "Mexican Peso"), + ("MXP", "Mexican Silver Peso (1861–1992)"), + ("MDC", "Moldovan Cupon"), + ("MDL", "Moldovan Leu"), + ("MCF", "Monegasque Franc"), + ("MNT", "Mongolian Tugrik"), + ("MAD", "Moroccan Dirham"), + ("MAF", "Moroccan Franc"), + ("MZE", "Mozambican Escudo"), + ("MZN", "Mozambican Metical"), + ("MZM", "Mozambican Metical (1980–2006)"), + ("MMK", "Myanmar Kyat"), + ("NAD", "Namibian Dollar"), + ("NPR", "Nepalese Rupee"), + ("ANG", "Netherlands Antillean Guilder"), + ("TWD", "New Taiwan Dollar"), + ("NZD", "New Zealand Dollar"), + ("NIO", "Nicaraguan Córdoba"), + ("NIC", "Nicaraguan Córdoba (1988–1991)"), + ("NGN", "Nigerian Naira"), + ("KPW", "North Korean Won"), + ("NOK", "Norwegian Krone"), + ("OMR", "Omani Rial"), + ("PKR", "Pakistani Rupee"), + ("XPD", "Palladium"), + ("PAB", "Panamanian Balboa"), + ("PGK", "Papua New Guinean Kina"), + ("PYG", "Paraguayan Guarani"), + ("PEI", "Peruvian Inti"), + ("PEN", "Peruvian Sol"), + ("PES", "Peruvian Sol (1863–1965)"), + ("PHP", "Philippine Peso"), + ("XPT", "Platinum"), + ("PLN", "Polish Zloty"), + ("PLZ", "Polish Zloty (1950–1995)"), + ("PTE", "Portuguese Escudo"), + ("GWE", "Portuguese Guinea Escudo"), + ("QAR", "Qatari Riyal"), + ("XRE", "RINET Funds"), + ("RHD", "Rhodesian Dollar"), + ("RON", "Romanian Leu"), + ("ROL", "Romanian Leu (1952–2006)"), + ("RUB", "Russian Ruble"), + ("RUR", "Russian Ruble (1991–1998)"), + ("RWF", "Rwandan Franc"), + ("SVC", "Salvadoran Colón"), + ("WST", "Samoan Tala"), + ("SAR", "Saudi Riyal"), + ("RSD", "Serbian Dinar"), + ("CSD", "Serbian Dinar (2002–2006)"), + ("SCR", "Seychellois Rupee"), + ("SLL", "Sierra Leonean Leone (1964—2022)"), + ("XAG", "Silver"), + ("SGD", "Singapore Dollar"), + ("SKK", "Slovak Koruna"), + ("SIT", "Slovenian Tolar"), + ("SBD", "Solomon Islands Dollar"), + ("SOS", "Somali Shilling"), + ("ZAR", "South African Rand"), + ("ZAL", "South African Rand (financial)"), + ("KRH", "South Korean Hwan (1953–1962)"), + ("KRW", "South Korean Won"), + ("KRO", "South Korean Won (1945–1953)"), + ("SSP", "South Sudanese Pound"), + ("SUR", "Soviet Rouble"), + ("ESP", "Spanish Peseta"), + ("ESA", "Spanish Peseta (A account)"), + ("ESB", "Spanish Peseta (convertible account)"), + ("XDR", "Special Drawing Rights"), + ("LKR", "Sri Lankan Rupee"), + ("SHP", "St. Helena Pound"), + ("XSU", "Sucre"), + ("SDD", "Sudanese Dinar (1992–2007)"), + ("SDG", "Sudanese Pound"), + ("SDP", "Sudanese Pound (1957–1998)"), + ("SRD", "Surinamese Dollar"), + ("SRG", "Surinamese Guilder"), + ("SZL", "Swazi Lilangeni"), + ("SEK", "Swedish Krona"), + ("CHF", "Swiss Franc"), + ("SYP", "Syrian Pound"), + ("STN", "São Tomé & Príncipe Dobra"), + ("STD", "São Tomé & Príncipe Dobra (1977–2017)"), + ("TVD", "TVD"), + ("TJR", "Tajikistani Ruble"), + ("TJS", "Tajikistani Somoni"), + ("TZS", "Tanzanian Shilling"), + ("XTS", "Testing Currency Code"), + ("THB", "Thai Baht"), + ( + "XXX", + "The codes assigned for transactions where no currency is involved", + ), + ("TPE", "Timorese Escudo"), + ("TOP", "Tongan Paʻanga"), + ("TTD", "Trinidad & Tobago Dollar"), + ("TND", "Tunisian Dinar"), + ("TRY", "Turkish Lira"), + ("TRL", "Turkish Lira (1922–2005)"), + ("TMT", "Turkmenistani Manat"), + ("TMM", "Turkmenistani Manat (1993–2009)"), + ("USD", "US Dollar"), + ("USN", "US Dollar (Next day)"), + ("USS", "US Dollar (Same day)"), + ("UGX", "Ugandan Shilling"), + ("UGS", "Ugandan Shilling (1966–1987)"), + ("UAH", "Ukrainian Hryvnia"), + ("UAK", "Ukrainian Karbovanets"), + ("AED", "United Arab Emirates Dirham"), + ("UYW", "Uruguayan Nominal Wage Index Unit"), + ("UYU", "Uruguayan Peso"), + ("UYP", "Uruguayan Peso (1975–1993)"), + ("UYI", "Uruguayan Peso (Indexed Units)"), + ("UZS", "Uzbekistani Som"), + ("VUV", "Vanuatu Vatu"), + ("VES", "Venezuelan Bolívar"), + ("VEB", "Venezuelan Bolívar (1871–2008)"), + ("VEF", "Venezuelan Bolívar (2008–2018)"), + ("VND", "Vietnamese Dong"), + ("VNN", "Vietnamese Dong (1978–1985)"), + ("CHE", "WIR Euro"), + ("CHW", "WIR Franc"), + ("XOF", "West African CFA Franc"), + ("YDD", "Yemeni Dinar"), + ("YER", "Yemeni Rial"), + ("YUN", "Yugoslavian Convertible Dinar (1990–1992)"), + ("YUD", "Yugoslavian Hard Dinar (1966–1990)"), + ("YUM", "Yugoslavian New Dinar (1994–2002)"), + ("YUR", "Yugoslavian Reformed Dinar (1992–1993)"), + ("ZWN", "ZWN"), + ("ZRN", "Zairean New Zaire (1993–1998)"), + ("ZRZ", "Zairean Zaire (1971–1993)"), + ("ZMW", "Zambian Kwacha"), + ("ZMK", "Zambian Kwacha (1968–2012)"), + ("ZWD", "Zimbabwean Dollar (1980–2008)"), + ("ZWR", "Zimbabwean Dollar (2008)"), + ("ZWL", "Zimbabwean Dollar (2009)"), + ], + default="CHF", + editable=False, + max_length=3, + null=True, + ), + ), + migrations.AlterField( + model_name="orderitem", + name="_base_fee_currency", + field=djmoney.models.fields.CurrencyField( + choices=[ + ("XUA", "ADB Unit of Account"), + ("AFN", "Afghan Afghani"), + ("AFA", "Afghan Afghani (1927–2002)"), + ("ALL", "Albanian Lek"), + ("ALK", "Albanian Lek (1946–1965)"), + ("DZD", "Algerian Dinar"), + ("ADP", "Andorran Peseta"), + ("AOA", "Angolan Kwanza"), + ("AOK", "Angolan Kwanza (1977–1991)"), + ("AON", "Angolan New Kwanza (1990–2000)"), + ("AOR", "Angolan Readjusted Kwanza (1995–1999)"), + ("ARA", "Argentine Austral"), + ("ARS", "Argentine Peso"), + ("ARM", "Argentine Peso (1881–1970)"), + ("ARP", "Argentine Peso (1983–1985)"), + ("ARL", "Argentine Peso Ley (1970–1983)"), + ("AMD", "Armenian Dram"), + ("AWG", "Aruban Florin"), + ("AUD", "Australian Dollar"), + ("ATS", "Austrian Schilling"), + ("AZN", "Azerbaijani Manat"), + ("AZM", "Azerbaijani Manat (1993–2006)"), + ("BSD", "Bahamian Dollar"), + ("BHD", "Bahraini Dinar"), + ("BDT", "Bangladeshi Taka"), + ("BBD", "Barbadian Dollar"), + ("BYN", "Belarusian Ruble"), + ("BYB", "Belarusian Ruble (1994–1999)"), + ("BYR", "Belarusian Ruble (2000–2016)"), + ("BEF", "Belgian Franc"), + ("BEC", "Belgian Franc (convertible)"), + ("BEL", "Belgian Franc (financial)"), + ("BZD", "Belize Dollar"), + ("BMD", "Bermudan Dollar"), + ("BTN", "Bhutanese Ngultrum"), + ("BOB", "Bolivian Boliviano"), + ("BOL", "Bolivian Boliviano (1863–1963)"), + ("BOV", "Bolivian Mvdol"), + ("BOP", "Bolivian Peso"), + ("BAM", "Bosnia-Herzegovina Convertible Mark"), + ("BAD", "Bosnia-Herzegovina Dinar (1992–1994)"), + ("BAN", "Bosnia-Herzegovina New Dinar (1994–1997)"), + ("BWP", "Botswanan Pula"), + ("BRC", "Brazilian Cruzado (1986–1989)"), + ("BRZ", "Brazilian Cruzeiro (1942–1967)"), + ("BRE", "Brazilian Cruzeiro (1990–1993)"), + ("BRR", "Brazilian Cruzeiro (1993–1994)"), + ("BRN", "Brazilian New Cruzado (1989–1990)"), + ("BRB", "Brazilian New Cruzeiro (1967–1986)"), + ("BRL", "Brazilian Real"), + ("GBP", "British Pound"), + ("BND", "Brunei Dollar"), + ("BGL", "Bulgarian Hard Lev"), + ("BGN", "Bulgarian Lev"), + ("BGO", "Bulgarian Lev (1879–1952)"), + ("BGM", "Bulgarian Socialist Lev"), + ("BUK", "Burmese Kyat"), + ("BIF", "Burundian Franc"), + ("XPF", "CFP Franc"), + ("KHR", "Cambodian Riel"), + ("CAD", "Canadian Dollar"), + ("CVE", "Cape Verdean Escudo"), + ("KYD", "Cayman Islands Dollar"), + ("XAF", "Central African CFA Franc"), + ("CLE", "Chilean Escudo"), + ("CLP", "Chilean Peso"), + ("CLF", "Chilean Unit of Account (UF)"), + ("CNX", "Chinese People’s Bank Dollar"), + ("CNY", "Chinese Yuan"), + ("CNH", "Chinese Yuan (offshore)"), + ("COP", "Colombian Peso"), + ("COU", "Colombian Real Value Unit"), + ("KMF", "Comorian Franc"), + ("CDF", "Congolese Franc"), + ("CRC", "Costa Rican Colón"), + ("HRD", "Croatian Dinar"), + ("HRK", "Croatian Kuna"), + ("CUC", "Cuban Convertible Peso"), + ("CUP", "Cuban Peso"), + ("CYP", "Cypriot Pound"), + ("CZK", "Czech Koruna"), + ("CSK", "Czechoslovak Hard Koruna"), + ("DKK", "Danish Krone"), + ("DJF", "Djiboutian Franc"), + ("DOP", "Dominican Peso"), + ("NLG", "Dutch Guilder"), + ("XCD", "East Caribbean Dollar"), + ("DDM", "East German Mark"), + ("ECS", "Ecuadorian Sucre"), + ("ECV", "Ecuadorian Unit of Constant Value"), + ("EGP", "Egyptian Pound"), + ("GQE", "Equatorial Guinean Ekwele"), + ("ERN", "Eritrean Nakfa"), + ("EEK", "Estonian Kroon"), + ("ETB", "Ethiopian Birr"), + ("EUR", "Euro"), + ("XBA", "European Composite Unit"), + ("XEU", "European Currency Unit"), + ("XBB", "European Monetary Unit"), + ("XBC", "European Unit of Account (XBC)"), + ("XBD", "European Unit of Account (XBD)"), + ("FKP", "Falkland Islands Pound"), + ("FJD", "Fijian Dollar"), + ("FIM", "Finnish Markka"), + ("FRF", "French Franc"), + ("XFO", "French Gold Franc"), + ("XFU", "French UIC-Franc"), + ("GMD", "Gambian Dalasi"), + ("GEK", "Georgian Kupon Larit"), + ("GEL", "Georgian Lari"), + ("DEM", "German Mark"), + ("GHS", "Ghanaian Cedi"), + ("GHC", "Ghanaian Cedi (1979–2007)"), + ("GIP", "Gibraltar Pound"), + ("XAU", "Gold"), + ("GRD", "Greek Drachma"), + ("GTQ", "Guatemalan Quetzal"), + ("GWP", "Guinea-Bissau Peso"), + ("GNF", "Guinean Franc"), + ("GNS", "Guinean Syli"), + ("GYD", "Guyanaese Dollar"), + ("HTG", "Haitian Gourde"), + ("HNL", "Honduran Lempira"), + ("HKD", "Hong Kong Dollar"), + ("HUF", "Hungarian Forint"), + ("IMP", "IMP"), + ("ISK", "Icelandic Króna"), + ("ISJ", "Icelandic Króna (1918–1981)"), + ("INR", "Indian Rupee"), + ("IDR", "Indonesian Rupiah"), + ("IRR", "Iranian Rial"), + ("IQD", "Iraqi Dinar"), + ("IEP", "Irish Pound"), + ("ILS", "Israeli New Shekel"), + ("ILP", "Israeli Pound"), + ("ILR", "Israeli Shekel (1980–1985)"), + ("ITL", "Italian Lira"), + ("JMD", "Jamaican Dollar"), + ("JPY", "Japanese Yen"), + ("JOD", "Jordanian Dinar"), + ("KZT", "Kazakhstani Tenge"), + ("KES", "Kenyan Shilling"), + ("KWD", "Kuwaiti Dinar"), + ("KGS", "Kyrgystani Som"), + ("LAK", "Laotian Kip"), + ("LVL", "Latvian Lats"), + ("LVR", "Latvian Ruble"), + ("LBP", "Lebanese Pound"), + ("LSL", "Lesotho Loti"), + ("LRD", "Liberian Dollar"), + ("LYD", "Libyan Dinar"), + ("LTL", "Lithuanian Litas"), + ("LTT", "Lithuanian Talonas"), + ("LUL", "Luxembourg Financial Franc"), + ("LUC", "Luxembourgian Convertible Franc"), + ("LUF", "Luxembourgian Franc"), + ("MOP", "Macanese Pataca"), + ("MKD", "Macedonian Denar"), + ("MKN", "Macedonian Denar (1992–1993)"), + ("MGA", "Malagasy Ariary"), + ("MGF", "Malagasy Franc"), + ("MWK", "Malawian Kwacha"), + ("MYR", "Malaysian Ringgit"), + ("MVR", "Maldivian Rufiyaa"), + ("MVP", "Maldivian Rupee (1947–1981)"), + ("MLF", "Malian Franc"), + ("MTL", "Maltese Lira"), + ("MTP", "Maltese Pound"), + ("MRU", "Mauritanian Ouguiya"), + ("MRO", "Mauritanian Ouguiya (1973–2017)"), + ("MUR", "Mauritian Rupee"), + ("MXV", "Mexican Investment Unit"), + ("MXN", "Mexican Peso"), + ("MXP", "Mexican Silver Peso (1861–1992)"), + ("MDC", "Moldovan Cupon"), + ("MDL", "Moldovan Leu"), + ("MCF", "Monegasque Franc"), + ("MNT", "Mongolian Tugrik"), + ("MAD", "Moroccan Dirham"), + ("MAF", "Moroccan Franc"), + ("MZE", "Mozambican Escudo"), + ("MZN", "Mozambican Metical"), + ("MZM", "Mozambican Metical (1980–2006)"), + ("MMK", "Myanmar Kyat"), + ("NAD", "Namibian Dollar"), + ("NPR", "Nepalese Rupee"), + ("ANG", "Netherlands Antillean Guilder"), + ("TWD", "New Taiwan Dollar"), + ("NZD", "New Zealand Dollar"), + ("NIO", "Nicaraguan Córdoba"), + ("NIC", "Nicaraguan Córdoba (1988–1991)"), + ("NGN", "Nigerian Naira"), + ("KPW", "North Korean Won"), + ("NOK", "Norwegian Krone"), + ("OMR", "Omani Rial"), + ("PKR", "Pakistani Rupee"), + ("XPD", "Palladium"), + ("PAB", "Panamanian Balboa"), + ("PGK", "Papua New Guinean Kina"), + ("PYG", "Paraguayan Guarani"), + ("PEI", "Peruvian Inti"), + ("PEN", "Peruvian Sol"), + ("PES", "Peruvian Sol (1863–1965)"), + ("PHP", "Philippine Peso"), + ("XPT", "Platinum"), + ("PLN", "Polish Zloty"), + ("PLZ", "Polish Zloty (1950–1995)"), + ("PTE", "Portuguese Escudo"), + ("GWE", "Portuguese Guinea Escudo"), + ("QAR", "Qatari Riyal"), + ("XRE", "RINET Funds"), + ("RHD", "Rhodesian Dollar"), + ("RON", "Romanian Leu"), + ("ROL", "Romanian Leu (1952–2006)"), + ("RUB", "Russian Ruble"), + ("RUR", "Russian Ruble (1991–1998)"), + ("RWF", "Rwandan Franc"), + ("SVC", "Salvadoran Colón"), + ("WST", "Samoan Tala"), + ("SAR", "Saudi Riyal"), + ("RSD", "Serbian Dinar"), + ("CSD", "Serbian Dinar (2002–2006)"), + ("SCR", "Seychellois Rupee"), + ("SLL", "Sierra Leonean Leone (1964—2022)"), + ("XAG", "Silver"), + ("SGD", "Singapore Dollar"), + ("SKK", "Slovak Koruna"), + ("SIT", "Slovenian Tolar"), + ("SBD", "Solomon Islands Dollar"), + ("SOS", "Somali Shilling"), + ("ZAR", "South African Rand"), + ("ZAL", "South African Rand (financial)"), + ("KRH", "South Korean Hwan (1953–1962)"), + ("KRW", "South Korean Won"), + ("KRO", "South Korean Won (1945–1953)"), + ("SSP", "South Sudanese Pound"), + ("SUR", "Soviet Rouble"), + ("ESP", "Spanish Peseta"), + ("ESA", "Spanish Peseta (A account)"), + ("ESB", "Spanish Peseta (convertible account)"), + ("XDR", "Special Drawing Rights"), + ("LKR", "Sri Lankan Rupee"), + ("SHP", "St. Helena Pound"), + ("XSU", "Sucre"), + ("SDD", "Sudanese Dinar (1992–2007)"), + ("SDG", "Sudanese Pound"), + ("SDP", "Sudanese Pound (1957–1998)"), + ("SRD", "Surinamese Dollar"), + ("SRG", "Surinamese Guilder"), + ("SZL", "Swazi Lilangeni"), + ("SEK", "Swedish Krona"), + ("CHF", "Swiss Franc"), + ("SYP", "Syrian Pound"), + ("STN", "São Tomé & Príncipe Dobra"), + ("STD", "São Tomé & Príncipe Dobra (1977–2017)"), + ("TVD", "TVD"), + ("TJR", "Tajikistani Ruble"), + ("TJS", "Tajikistani Somoni"), + ("TZS", "Tanzanian Shilling"), + ("XTS", "Testing Currency Code"), + ("THB", "Thai Baht"), + ( + "XXX", + "The codes assigned for transactions where no currency is involved", + ), + ("TPE", "Timorese Escudo"), + ("TOP", "Tongan Paʻanga"), + ("TTD", "Trinidad & Tobago Dollar"), + ("TND", "Tunisian Dinar"), + ("TRY", "Turkish Lira"), + ("TRL", "Turkish Lira (1922–2005)"), + ("TMT", "Turkmenistani Manat"), + ("TMM", "Turkmenistani Manat (1993–2009)"), + ("USD", "US Dollar"), + ("USN", "US Dollar (Next day)"), + ("USS", "US Dollar (Same day)"), + ("UGX", "Ugandan Shilling"), + ("UGS", "Ugandan Shilling (1966–1987)"), + ("UAH", "Ukrainian Hryvnia"), + ("UAK", "Ukrainian Karbovanets"), + ("AED", "United Arab Emirates Dirham"), + ("UYW", "Uruguayan Nominal Wage Index Unit"), + ("UYU", "Uruguayan Peso"), + ("UYP", "Uruguayan Peso (1975–1993)"), + ("UYI", "Uruguayan Peso (Indexed Units)"), + ("UZS", "Uzbekistani Som"), + ("VUV", "Vanuatu Vatu"), + ("VES", "Venezuelan Bolívar"), + ("VEB", "Venezuelan Bolívar (1871–2008)"), + ("VEF", "Venezuelan Bolívar (2008–2018)"), + ("VND", "Vietnamese Dong"), + ("VNN", "Vietnamese Dong (1978–1985)"), + ("CHE", "WIR Euro"), + ("CHW", "WIR Franc"), + ("XOF", "West African CFA Franc"), + ("YDD", "Yemeni Dinar"), + ("YER", "Yemeni Rial"), + ("YUN", "Yugoslavian Convertible Dinar (1990–1992)"), + ("YUD", "Yugoslavian Hard Dinar (1966–1990)"), + ("YUM", "Yugoslavian New Dinar (1994–2002)"), + ("YUR", "Yugoslavian Reformed Dinar (1992–1993)"), + ("ZWN", "ZWN"), + ("ZRN", "Zairean New Zaire (1993–1998)"), + ("ZRZ", "Zairean Zaire (1971–1993)"), + ("ZMW", "Zambian Kwacha"), + ("ZMK", "Zambian Kwacha (1968–2012)"), + ("ZWD", "Zimbabwean Dollar (1980–2008)"), + ("ZWR", "Zimbabwean Dollar (2008)"), + ("ZWL", "Zimbabwean Dollar (2009)"), + ], + default="CHF", + editable=False, + max_length=3, + null=True, + ), + ), + migrations.AlterField( + model_name="orderitem", + name="_price_currency", + field=djmoney.models.fields.CurrencyField( + choices=[ + ("XUA", "ADB Unit of Account"), + ("AFN", "Afghan Afghani"), + ("AFA", "Afghan Afghani (1927–2002)"), + ("ALL", "Albanian Lek"), + ("ALK", "Albanian Lek (1946–1965)"), + ("DZD", "Algerian Dinar"), + ("ADP", "Andorran Peseta"), + ("AOA", "Angolan Kwanza"), + ("AOK", "Angolan Kwanza (1977–1991)"), + ("AON", "Angolan New Kwanza (1990–2000)"), + ("AOR", "Angolan Readjusted Kwanza (1995–1999)"), + ("ARA", "Argentine Austral"), + ("ARS", "Argentine Peso"), + ("ARM", "Argentine Peso (1881–1970)"), + ("ARP", "Argentine Peso (1983–1985)"), + ("ARL", "Argentine Peso Ley (1970–1983)"), + ("AMD", "Armenian Dram"), + ("AWG", "Aruban Florin"), + ("AUD", "Australian Dollar"), + ("ATS", "Austrian Schilling"), + ("AZN", "Azerbaijani Manat"), + ("AZM", "Azerbaijani Manat (1993–2006)"), + ("BSD", "Bahamian Dollar"), + ("BHD", "Bahraini Dinar"), + ("BDT", "Bangladeshi Taka"), + ("BBD", "Barbadian Dollar"), + ("BYN", "Belarusian Ruble"), + ("BYB", "Belarusian Ruble (1994–1999)"), + ("BYR", "Belarusian Ruble (2000–2016)"), + ("BEF", "Belgian Franc"), + ("BEC", "Belgian Franc (convertible)"), + ("BEL", "Belgian Franc (financial)"), + ("BZD", "Belize Dollar"), + ("BMD", "Bermudan Dollar"), + ("BTN", "Bhutanese Ngultrum"), + ("BOB", "Bolivian Boliviano"), + ("BOL", "Bolivian Boliviano (1863–1963)"), + ("BOV", "Bolivian Mvdol"), + ("BOP", "Bolivian Peso"), + ("BAM", "Bosnia-Herzegovina Convertible Mark"), + ("BAD", "Bosnia-Herzegovina Dinar (1992–1994)"), + ("BAN", "Bosnia-Herzegovina New Dinar (1994–1997)"), + ("BWP", "Botswanan Pula"), + ("BRC", "Brazilian Cruzado (1986–1989)"), + ("BRZ", "Brazilian Cruzeiro (1942–1967)"), + ("BRE", "Brazilian Cruzeiro (1990–1993)"), + ("BRR", "Brazilian Cruzeiro (1993–1994)"), + ("BRN", "Brazilian New Cruzado (1989–1990)"), + ("BRB", "Brazilian New Cruzeiro (1967–1986)"), + ("BRL", "Brazilian Real"), + ("GBP", "British Pound"), + ("BND", "Brunei Dollar"), + ("BGL", "Bulgarian Hard Lev"), + ("BGN", "Bulgarian Lev"), + ("BGO", "Bulgarian Lev (1879–1952)"), + ("BGM", "Bulgarian Socialist Lev"), + ("BUK", "Burmese Kyat"), + ("BIF", "Burundian Franc"), + ("XPF", "CFP Franc"), + ("KHR", "Cambodian Riel"), + ("CAD", "Canadian Dollar"), + ("CVE", "Cape Verdean Escudo"), + ("KYD", "Cayman Islands Dollar"), + ("XAF", "Central African CFA Franc"), + ("CLE", "Chilean Escudo"), + ("CLP", "Chilean Peso"), + ("CLF", "Chilean Unit of Account (UF)"), + ("CNX", "Chinese People’s Bank Dollar"), + ("CNY", "Chinese Yuan"), + ("CNH", "Chinese Yuan (offshore)"), + ("COP", "Colombian Peso"), + ("COU", "Colombian Real Value Unit"), + ("KMF", "Comorian Franc"), + ("CDF", "Congolese Franc"), + ("CRC", "Costa Rican Colón"), + ("HRD", "Croatian Dinar"), + ("HRK", "Croatian Kuna"), + ("CUC", "Cuban Convertible Peso"), + ("CUP", "Cuban Peso"), + ("CYP", "Cypriot Pound"), + ("CZK", "Czech Koruna"), + ("CSK", "Czechoslovak Hard Koruna"), + ("DKK", "Danish Krone"), + ("DJF", "Djiboutian Franc"), + ("DOP", "Dominican Peso"), + ("NLG", "Dutch Guilder"), + ("XCD", "East Caribbean Dollar"), + ("DDM", "East German Mark"), + ("ECS", "Ecuadorian Sucre"), + ("ECV", "Ecuadorian Unit of Constant Value"), + ("EGP", "Egyptian Pound"), + ("GQE", "Equatorial Guinean Ekwele"), + ("ERN", "Eritrean Nakfa"), + ("EEK", "Estonian Kroon"), + ("ETB", "Ethiopian Birr"), + ("EUR", "Euro"), + ("XBA", "European Composite Unit"), + ("XEU", "European Currency Unit"), + ("XBB", "European Monetary Unit"), + ("XBC", "European Unit of Account (XBC)"), + ("XBD", "European Unit of Account (XBD)"), + ("FKP", "Falkland Islands Pound"), + ("FJD", "Fijian Dollar"), + ("FIM", "Finnish Markka"), + ("FRF", "French Franc"), + ("XFO", "French Gold Franc"), + ("XFU", "French UIC-Franc"), + ("GMD", "Gambian Dalasi"), + ("GEK", "Georgian Kupon Larit"), + ("GEL", "Georgian Lari"), + ("DEM", "German Mark"), + ("GHS", "Ghanaian Cedi"), + ("GHC", "Ghanaian Cedi (1979–2007)"), + ("GIP", "Gibraltar Pound"), + ("XAU", "Gold"), + ("GRD", "Greek Drachma"), + ("GTQ", "Guatemalan Quetzal"), + ("GWP", "Guinea-Bissau Peso"), + ("GNF", "Guinean Franc"), + ("GNS", "Guinean Syli"), + ("GYD", "Guyanaese Dollar"), + ("HTG", "Haitian Gourde"), + ("HNL", "Honduran Lempira"), + ("HKD", "Hong Kong Dollar"), + ("HUF", "Hungarian Forint"), + ("IMP", "IMP"), + ("ISK", "Icelandic Króna"), + ("ISJ", "Icelandic Króna (1918–1981)"), + ("INR", "Indian Rupee"), + ("IDR", "Indonesian Rupiah"), + ("IRR", "Iranian Rial"), + ("IQD", "Iraqi Dinar"), + ("IEP", "Irish Pound"), + ("ILS", "Israeli New Shekel"), + ("ILP", "Israeli Pound"), + ("ILR", "Israeli Shekel (1980–1985)"), + ("ITL", "Italian Lira"), + ("JMD", "Jamaican Dollar"), + ("JPY", "Japanese Yen"), + ("JOD", "Jordanian Dinar"), + ("KZT", "Kazakhstani Tenge"), + ("KES", "Kenyan Shilling"), + ("KWD", "Kuwaiti Dinar"), + ("KGS", "Kyrgystani Som"), + ("LAK", "Laotian Kip"), + ("LVL", "Latvian Lats"), + ("LVR", "Latvian Ruble"), + ("LBP", "Lebanese Pound"), + ("LSL", "Lesotho Loti"), + ("LRD", "Liberian Dollar"), + ("LYD", "Libyan Dinar"), + ("LTL", "Lithuanian Litas"), + ("LTT", "Lithuanian Talonas"), + ("LUL", "Luxembourg Financial Franc"), + ("LUC", "Luxembourgian Convertible Franc"), + ("LUF", "Luxembourgian Franc"), + ("MOP", "Macanese Pataca"), + ("MKD", "Macedonian Denar"), + ("MKN", "Macedonian Denar (1992–1993)"), + ("MGA", "Malagasy Ariary"), + ("MGF", "Malagasy Franc"), + ("MWK", "Malawian Kwacha"), + ("MYR", "Malaysian Ringgit"), + ("MVR", "Maldivian Rufiyaa"), + ("MVP", "Maldivian Rupee (1947–1981)"), + ("MLF", "Malian Franc"), + ("MTL", "Maltese Lira"), + ("MTP", "Maltese Pound"), + ("MRU", "Mauritanian Ouguiya"), + ("MRO", "Mauritanian Ouguiya (1973–2017)"), + ("MUR", "Mauritian Rupee"), + ("MXV", "Mexican Investment Unit"), + ("MXN", "Mexican Peso"), + ("MXP", "Mexican Silver Peso (1861–1992)"), + ("MDC", "Moldovan Cupon"), + ("MDL", "Moldovan Leu"), + ("MCF", "Monegasque Franc"), + ("MNT", "Mongolian Tugrik"), + ("MAD", "Moroccan Dirham"), + ("MAF", "Moroccan Franc"), + ("MZE", "Mozambican Escudo"), + ("MZN", "Mozambican Metical"), + ("MZM", "Mozambican Metical (1980–2006)"), + ("MMK", "Myanmar Kyat"), + ("NAD", "Namibian Dollar"), + ("NPR", "Nepalese Rupee"), + ("ANG", "Netherlands Antillean Guilder"), + ("TWD", "New Taiwan Dollar"), + ("NZD", "New Zealand Dollar"), + ("NIO", "Nicaraguan Córdoba"), + ("NIC", "Nicaraguan Córdoba (1988–1991)"), + ("NGN", "Nigerian Naira"), + ("KPW", "North Korean Won"), + ("NOK", "Norwegian Krone"), + ("OMR", "Omani Rial"), + ("PKR", "Pakistani Rupee"), + ("XPD", "Palladium"), + ("PAB", "Panamanian Balboa"), + ("PGK", "Papua New Guinean Kina"), + ("PYG", "Paraguayan Guarani"), + ("PEI", "Peruvian Inti"), + ("PEN", "Peruvian Sol"), + ("PES", "Peruvian Sol (1863–1965)"), + ("PHP", "Philippine Peso"), + ("XPT", "Platinum"), + ("PLN", "Polish Zloty"), + ("PLZ", "Polish Zloty (1950–1995)"), + ("PTE", "Portuguese Escudo"), + ("GWE", "Portuguese Guinea Escudo"), + ("QAR", "Qatari Riyal"), + ("XRE", "RINET Funds"), + ("RHD", "Rhodesian Dollar"), + ("RON", "Romanian Leu"), + ("ROL", "Romanian Leu (1952–2006)"), + ("RUB", "Russian Ruble"), + ("RUR", "Russian Ruble (1991–1998)"), + ("RWF", "Rwandan Franc"), + ("SVC", "Salvadoran Colón"), + ("WST", "Samoan Tala"), + ("SAR", "Saudi Riyal"), + ("RSD", "Serbian Dinar"), + ("CSD", "Serbian Dinar (2002–2006)"), + ("SCR", "Seychellois Rupee"), + ("SLL", "Sierra Leonean Leone (1964—2022)"), + ("XAG", "Silver"), + ("SGD", "Singapore Dollar"), + ("SKK", "Slovak Koruna"), + ("SIT", "Slovenian Tolar"), + ("SBD", "Solomon Islands Dollar"), + ("SOS", "Somali Shilling"), + ("ZAR", "South African Rand"), + ("ZAL", "South African Rand (financial)"), + ("KRH", "South Korean Hwan (1953–1962)"), + ("KRW", "South Korean Won"), + ("KRO", "South Korean Won (1945–1953)"), + ("SSP", "South Sudanese Pound"), + ("SUR", "Soviet Rouble"), + ("ESP", "Spanish Peseta"), + ("ESA", "Spanish Peseta (A account)"), + ("ESB", "Spanish Peseta (convertible account)"), + ("XDR", "Special Drawing Rights"), + ("LKR", "Sri Lankan Rupee"), + ("SHP", "St. Helena Pound"), + ("XSU", "Sucre"), + ("SDD", "Sudanese Dinar (1992–2007)"), + ("SDG", "Sudanese Pound"), + ("SDP", "Sudanese Pound (1957–1998)"), + ("SRD", "Surinamese Dollar"), + ("SRG", "Surinamese Guilder"), + ("SZL", "Swazi Lilangeni"), + ("SEK", "Swedish Krona"), + ("CHF", "Swiss Franc"), + ("SYP", "Syrian Pound"), + ("STN", "São Tomé & Príncipe Dobra"), + ("STD", "São Tomé & Príncipe Dobra (1977–2017)"), + ("TVD", "TVD"), + ("TJR", "Tajikistani Ruble"), + ("TJS", "Tajikistani Somoni"), + ("TZS", "Tanzanian Shilling"), + ("XTS", "Testing Currency Code"), + ("THB", "Thai Baht"), + ( + "XXX", + "The codes assigned for transactions where no currency is involved", + ), + ("TPE", "Timorese Escudo"), + ("TOP", "Tongan Paʻanga"), + ("TTD", "Trinidad & Tobago Dollar"), + ("TND", "Tunisian Dinar"), + ("TRY", "Turkish Lira"), + ("TRL", "Turkish Lira (1922–2005)"), + ("TMT", "Turkmenistani Manat"), + ("TMM", "Turkmenistani Manat (1993–2009)"), + ("USD", "US Dollar"), + ("USN", "US Dollar (Next day)"), + ("USS", "US Dollar (Same day)"), + ("UGX", "Ugandan Shilling"), + ("UGS", "Ugandan Shilling (1966–1987)"), + ("UAH", "Ukrainian Hryvnia"), + ("UAK", "Ukrainian Karbovanets"), + ("AED", "United Arab Emirates Dirham"), + ("UYW", "Uruguayan Nominal Wage Index Unit"), + ("UYU", "Uruguayan Peso"), + ("UYP", "Uruguayan Peso (1975–1993)"), + ("UYI", "Uruguayan Peso (Indexed Units)"), + ("UZS", "Uzbekistani Som"), + ("VUV", "Vanuatu Vatu"), + ("VES", "Venezuelan Bolívar"), + ("VEB", "Venezuelan Bolívar (1871–2008)"), + ("VEF", "Venezuelan Bolívar (2008–2018)"), + ("VND", "Vietnamese Dong"), + ("VNN", "Vietnamese Dong (1978–1985)"), + ("CHE", "WIR Euro"), + ("CHW", "WIR Franc"), + ("XOF", "West African CFA Franc"), + ("YDD", "Yemeni Dinar"), + ("YER", "Yemeni Rial"), + ("YUN", "Yugoslavian Convertible Dinar (1990–1992)"), + ("YUD", "Yugoslavian Hard Dinar (1966–1990)"), + ("YUM", "Yugoslavian New Dinar (1994–2002)"), + ("YUR", "Yugoslavian Reformed Dinar (1992–1993)"), + ("ZWN", "ZWN"), + ("ZRN", "Zairean New Zaire (1993–1998)"), + ("ZRZ", "Zairean Zaire (1971–1993)"), + ("ZMW", "Zambian Kwacha"), + ("ZMK", "Zambian Kwacha (1968–2012)"), + ("ZWD", "Zimbabwean Dollar (1980–2008)"), + ("ZWR", "Zimbabwean Dollar (2008)"), + ("ZWL", "Zimbabwean Dollar (2009)"), + ], + default="CHF", + editable=False, + max_length=3, + null=True, + ), + ), + migrations.AlterField( + model_name="pricing", + name="base_fee_currency", + field=djmoney.models.fields.CurrencyField( + choices=[ + ("XUA", "ADB Unit of Account"), + ("AFN", "Afghan Afghani"), + ("AFA", "Afghan Afghani (1927–2002)"), + ("ALL", "Albanian Lek"), + ("ALK", "Albanian Lek (1946–1965)"), + ("DZD", "Algerian Dinar"), + ("ADP", "Andorran Peseta"), + ("AOA", "Angolan Kwanza"), + ("AOK", "Angolan Kwanza (1977–1991)"), + ("AON", "Angolan New Kwanza (1990–2000)"), + ("AOR", "Angolan Readjusted Kwanza (1995–1999)"), + ("ARA", "Argentine Austral"), + ("ARS", "Argentine Peso"), + ("ARM", "Argentine Peso (1881–1970)"), + ("ARP", "Argentine Peso (1983–1985)"), + ("ARL", "Argentine Peso Ley (1970–1983)"), + ("AMD", "Armenian Dram"), + ("AWG", "Aruban Florin"), + ("AUD", "Australian Dollar"), + ("ATS", "Austrian Schilling"), + ("AZN", "Azerbaijani Manat"), + ("AZM", "Azerbaijani Manat (1993–2006)"), + ("BSD", "Bahamian Dollar"), + ("BHD", "Bahraini Dinar"), + ("BDT", "Bangladeshi Taka"), + ("BBD", "Barbadian Dollar"), + ("BYN", "Belarusian Ruble"), + ("BYB", "Belarusian Ruble (1994–1999)"), + ("BYR", "Belarusian Ruble (2000–2016)"), + ("BEF", "Belgian Franc"), + ("BEC", "Belgian Franc (convertible)"), + ("BEL", "Belgian Franc (financial)"), + ("BZD", "Belize Dollar"), + ("BMD", "Bermudan Dollar"), + ("BTN", "Bhutanese Ngultrum"), + ("BOB", "Bolivian Boliviano"), + ("BOL", "Bolivian Boliviano (1863–1963)"), + ("BOV", "Bolivian Mvdol"), + ("BOP", "Bolivian Peso"), + ("BAM", "Bosnia-Herzegovina Convertible Mark"), + ("BAD", "Bosnia-Herzegovina Dinar (1992–1994)"), + ("BAN", "Bosnia-Herzegovina New Dinar (1994–1997)"), + ("BWP", "Botswanan Pula"), + ("BRC", "Brazilian Cruzado (1986–1989)"), + ("BRZ", "Brazilian Cruzeiro (1942–1967)"), + ("BRE", "Brazilian Cruzeiro (1990–1993)"), + ("BRR", "Brazilian Cruzeiro (1993–1994)"), + ("BRN", "Brazilian New Cruzado (1989–1990)"), + ("BRB", "Brazilian New Cruzeiro (1967–1986)"), + ("BRL", "Brazilian Real"), + ("GBP", "British Pound"), + ("BND", "Brunei Dollar"), + ("BGL", "Bulgarian Hard Lev"), + ("BGN", "Bulgarian Lev"), + ("BGO", "Bulgarian Lev (1879–1952)"), + ("BGM", "Bulgarian Socialist Lev"), + ("BUK", "Burmese Kyat"), + ("BIF", "Burundian Franc"), + ("XPF", "CFP Franc"), + ("KHR", "Cambodian Riel"), + ("CAD", "Canadian Dollar"), + ("CVE", "Cape Verdean Escudo"), + ("KYD", "Cayman Islands Dollar"), + ("XAF", "Central African CFA Franc"), + ("CLE", "Chilean Escudo"), + ("CLP", "Chilean Peso"), + ("CLF", "Chilean Unit of Account (UF)"), + ("CNX", "Chinese People’s Bank Dollar"), + ("CNY", "Chinese Yuan"), + ("CNH", "Chinese Yuan (offshore)"), + ("COP", "Colombian Peso"), + ("COU", "Colombian Real Value Unit"), + ("KMF", "Comorian Franc"), + ("CDF", "Congolese Franc"), + ("CRC", "Costa Rican Colón"), + ("HRD", "Croatian Dinar"), + ("HRK", "Croatian Kuna"), + ("CUC", "Cuban Convertible Peso"), + ("CUP", "Cuban Peso"), + ("CYP", "Cypriot Pound"), + ("CZK", "Czech Koruna"), + ("CSK", "Czechoslovak Hard Koruna"), + ("DKK", "Danish Krone"), + ("DJF", "Djiboutian Franc"), + ("DOP", "Dominican Peso"), + ("NLG", "Dutch Guilder"), + ("XCD", "East Caribbean Dollar"), + ("DDM", "East German Mark"), + ("ECS", "Ecuadorian Sucre"), + ("ECV", "Ecuadorian Unit of Constant Value"), + ("EGP", "Egyptian Pound"), + ("GQE", "Equatorial Guinean Ekwele"), + ("ERN", "Eritrean Nakfa"), + ("EEK", "Estonian Kroon"), + ("ETB", "Ethiopian Birr"), + ("EUR", "Euro"), + ("XBA", "European Composite Unit"), + ("XEU", "European Currency Unit"), + ("XBB", "European Monetary Unit"), + ("XBC", "European Unit of Account (XBC)"), + ("XBD", "European Unit of Account (XBD)"), + ("FKP", "Falkland Islands Pound"), + ("FJD", "Fijian Dollar"), + ("FIM", "Finnish Markka"), + ("FRF", "French Franc"), + ("XFO", "French Gold Franc"), + ("XFU", "French UIC-Franc"), + ("GMD", "Gambian Dalasi"), + ("GEK", "Georgian Kupon Larit"), + ("GEL", "Georgian Lari"), + ("DEM", "German Mark"), + ("GHS", "Ghanaian Cedi"), + ("GHC", "Ghanaian Cedi (1979–2007)"), + ("GIP", "Gibraltar Pound"), + ("XAU", "Gold"), + ("GRD", "Greek Drachma"), + ("GTQ", "Guatemalan Quetzal"), + ("GWP", "Guinea-Bissau Peso"), + ("GNF", "Guinean Franc"), + ("GNS", "Guinean Syli"), + ("GYD", "Guyanaese Dollar"), + ("HTG", "Haitian Gourde"), + ("HNL", "Honduran Lempira"), + ("HKD", "Hong Kong Dollar"), + ("HUF", "Hungarian Forint"), + ("IMP", "IMP"), + ("ISK", "Icelandic Króna"), + ("ISJ", "Icelandic Króna (1918–1981)"), + ("INR", "Indian Rupee"), + ("IDR", "Indonesian Rupiah"), + ("IRR", "Iranian Rial"), + ("IQD", "Iraqi Dinar"), + ("IEP", "Irish Pound"), + ("ILS", "Israeli New Shekel"), + ("ILP", "Israeli Pound"), + ("ILR", "Israeli Shekel (1980–1985)"), + ("ITL", "Italian Lira"), + ("JMD", "Jamaican Dollar"), + ("JPY", "Japanese Yen"), + ("JOD", "Jordanian Dinar"), + ("KZT", "Kazakhstani Tenge"), + ("KES", "Kenyan Shilling"), + ("KWD", "Kuwaiti Dinar"), + ("KGS", "Kyrgystani Som"), + ("LAK", "Laotian Kip"), + ("LVL", "Latvian Lats"), + ("LVR", "Latvian Ruble"), + ("LBP", "Lebanese Pound"), + ("LSL", "Lesotho Loti"), + ("LRD", "Liberian Dollar"), + ("LYD", "Libyan Dinar"), + ("LTL", "Lithuanian Litas"), + ("LTT", "Lithuanian Talonas"), + ("LUL", "Luxembourg Financial Franc"), + ("LUC", "Luxembourgian Convertible Franc"), + ("LUF", "Luxembourgian Franc"), + ("MOP", "Macanese Pataca"), + ("MKD", "Macedonian Denar"), + ("MKN", "Macedonian Denar (1992–1993)"), + ("MGA", "Malagasy Ariary"), + ("MGF", "Malagasy Franc"), + ("MWK", "Malawian Kwacha"), + ("MYR", "Malaysian Ringgit"), + ("MVR", "Maldivian Rufiyaa"), + ("MVP", "Maldivian Rupee (1947–1981)"), + ("MLF", "Malian Franc"), + ("MTL", "Maltese Lira"), + ("MTP", "Maltese Pound"), + ("MRU", "Mauritanian Ouguiya"), + ("MRO", "Mauritanian Ouguiya (1973–2017)"), + ("MUR", "Mauritian Rupee"), + ("MXV", "Mexican Investment Unit"), + ("MXN", "Mexican Peso"), + ("MXP", "Mexican Silver Peso (1861–1992)"), + ("MDC", "Moldovan Cupon"), + ("MDL", "Moldovan Leu"), + ("MCF", "Monegasque Franc"), + ("MNT", "Mongolian Tugrik"), + ("MAD", "Moroccan Dirham"), + ("MAF", "Moroccan Franc"), + ("MZE", "Mozambican Escudo"), + ("MZN", "Mozambican Metical"), + ("MZM", "Mozambican Metical (1980–2006)"), + ("MMK", "Myanmar Kyat"), + ("NAD", "Namibian Dollar"), + ("NPR", "Nepalese Rupee"), + ("ANG", "Netherlands Antillean Guilder"), + ("TWD", "New Taiwan Dollar"), + ("NZD", "New Zealand Dollar"), + ("NIO", "Nicaraguan Córdoba"), + ("NIC", "Nicaraguan Córdoba (1988–1991)"), + ("NGN", "Nigerian Naira"), + ("KPW", "North Korean Won"), + ("NOK", "Norwegian Krone"), + ("OMR", "Omani Rial"), + ("PKR", "Pakistani Rupee"), + ("XPD", "Palladium"), + ("PAB", "Panamanian Balboa"), + ("PGK", "Papua New Guinean Kina"), + ("PYG", "Paraguayan Guarani"), + ("PEI", "Peruvian Inti"), + ("PEN", "Peruvian Sol"), + ("PES", "Peruvian Sol (1863–1965)"), + ("PHP", "Philippine Peso"), + ("XPT", "Platinum"), + ("PLN", "Polish Zloty"), + ("PLZ", "Polish Zloty (1950–1995)"), + ("PTE", "Portuguese Escudo"), + ("GWE", "Portuguese Guinea Escudo"), + ("QAR", "Qatari Riyal"), + ("XRE", "RINET Funds"), + ("RHD", "Rhodesian Dollar"), + ("RON", "Romanian Leu"), + ("ROL", "Romanian Leu (1952–2006)"), + ("RUB", "Russian Ruble"), + ("RUR", "Russian Ruble (1991–1998)"), + ("RWF", "Rwandan Franc"), + ("SVC", "Salvadoran Colón"), + ("WST", "Samoan Tala"), + ("SAR", "Saudi Riyal"), + ("RSD", "Serbian Dinar"), + ("CSD", "Serbian Dinar (2002–2006)"), + ("SCR", "Seychellois Rupee"), + ("SLL", "Sierra Leonean Leone (1964—2022)"), + ("XAG", "Silver"), + ("SGD", "Singapore Dollar"), + ("SKK", "Slovak Koruna"), + ("SIT", "Slovenian Tolar"), + ("SBD", "Solomon Islands Dollar"), + ("SOS", "Somali Shilling"), + ("ZAR", "South African Rand"), + ("ZAL", "South African Rand (financial)"), + ("KRH", "South Korean Hwan (1953–1962)"), + ("KRW", "South Korean Won"), + ("KRO", "South Korean Won (1945–1953)"), + ("SSP", "South Sudanese Pound"), + ("SUR", "Soviet Rouble"), + ("ESP", "Spanish Peseta"), + ("ESA", "Spanish Peseta (A account)"), + ("ESB", "Spanish Peseta (convertible account)"), + ("XDR", "Special Drawing Rights"), + ("LKR", "Sri Lankan Rupee"), + ("SHP", "St. Helena Pound"), + ("XSU", "Sucre"), + ("SDD", "Sudanese Dinar (1992–2007)"), + ("SDG", "Sudanese Pound"), + ("SDP", "Sudanese Pound (1957–1998)"), + ("SRD", "Surinamese Dollar"), + ("SRG", "Surinamese Guilder"), + ("SZL", "Swazi Lilangeni"), + ("SEK", "Swedish Krona"), + ("CHF", "Swiss Franc"), + ("SYP", "Syrian Pound"), + ("STN", "São Tomé & Príncipe Dobra"), + ("STD", "São Tomé & Príncipe Dobra (1977–2017)"), + ("TVD", "TVD"), + ("TJR", "Tajikistani Ruble"), + ("TJS", "Tajikistani Somoni"), + ("TZS", "Tanzanian Shilling"), + ("XTS", "Testing Currency Code"), + ("THB", "Thai Baht"), + ( + "XXX", + "The codes assigned for transactions where no currency is involved", + ), + ("TPE", "Timorese Escudo"), + ("TOP", "Tongan Paʻanga"), + ("TTD", "Trinidad & Tobago Dollar"), + ("TND", "Tunisian Dinar"), + ("TRY", "Turkish Lira"), + ("TRL", "Turkish Lira (1922–2005)"), + ("TMT", "Turkmenistani Manat"), + ("TMM", "Turkmenistani Manat (1993–2009)"), + ("USD", "US Dollar"), + ("USN", "US Dollar (Next day)"), + ("USS", "US Dollar (Same day)"), + ("UGX", "Ugandan Shilling"), + ("UGS", "Ugandan Shilling (1966–1987)"), + ("UAH", "Ukrainian Hryvnia"), + ("UAK", "Ukrainian Karbovanets"), + ("AED", "United Arab Emirates Dirham"), + ("UYW", "Uruguayan Nominal Wage Index Unit"), + ("UYU", "Uruguayan Peso"), + ("UYP", "Uruguayan Peso (1975–1993)"), + ("UYI", "Uruguayan Peso (Indexed Units)"), + ("UZS", "Uzbekistani Som"), + ("VUV", "Vanuatu Vatu"), + ("VES", "Venezuelan Bolívar"), + ("VEB", "Venezuelan Bolívar (1871–2008)"), + ("VEF", "Venezuelan Bolívar (2008–2018)"), + ("VND", "Vietnamese Dong"), + ("VNN", "Vietnamese Dong (1978–1985)"), + ("CHE", "WIR Euro"), + ("CHW", "WIR Franc"), + ("XOF", "West African CFA Franc"), + ("YDD", "Yemeni Dinar"), + ("YER", "Yemeni Rial"), + ("YUN", "Yugoslavian Convertible Dinar (1990–1992)"), + ("YUD", "Yugoslavian Hard Dinar (1966–1990)"), + ("YUM", "Yugoslavian New Dinar (1994–2002)"), + ("YUR", "Yugoslavian Reformed Dinar (1992–1993)"), + ("ZWN", "ZWN"), + ("ZRN", "Zairean New Zaire (1993–1998)"), + ("ZRZ", "Zairean Zaire (1971–1993)"), + ("ZMW", "Zambian Kwacha"), + ("ZMK", "Zambian Kwacha (1968–2012)"), + ("ZWD", "Zimbabwean Dollar (1980–2008)"), + ("ZWR", "Zimbabwean Dollar (2008)"), + ("ZWL", "Zimbabwean Dollar (2009)"), + ], + default="CHF", + editable=False, + max_length=3, + null=True, + ), + ), + migrations.AlterField( + model_name="pricing", + name="max_price_currency", + field=djmoney.models.fields.CurrencyField( + choices=[ + ("XUA", "ADB Unit of Account"), + ("AFN", "Afghan Afghani"), + ("AFA", "Afghan Afghani (1927–2002)"), + ("ALL", "Albanian Lek"), + ("ALK", "Albanian Lek (1946–1965)"), + ("DZD", "Algerian Dinar"), + ("ADP", "Andorran Peseta"), + ("AOA", "Angolan Kwanza"), + ("AOK", "Angolan Kwanza (1977–1991)"), + ("AON", "Angolan New Kwanza (1990–2000)"), + ("AOR", "Angolan Readjusted Kwanza (1995–1999)"), + ("ARA", "Argentine Austral"), + ("ARS", "Argentine Peso"), + ("ARM", "Argentine Peso (1881–1970)"), + ("ARP", "Argentine Peso (1983–1985)"), + ("ARL", "Argentine Peso Ley (1970–1983)"), + ("AMD", "Armenian Dram"), + ("AWG", "Aruban Florin"), + ("AUD", "Australian Dollar"), + ("ATS", "Austrian Schilling"), + ("AZN", "Azerbaijani Manat"), + ("AZM", "Azerbaijani Manat (1993–2006)"), + ("BSD", "Bahamian Dollar"), + ("BHD", "Bahraini Dinar"), + ("BDT", "Bangladeshi Taka"), + ("BBD", "Barbadian Dollar"), + ("BYN", "Belarusian Ruble"), + ("BYB", "Belarusian Ruble (1994–1999)"), + ("BYR", "Belarusian Ruble (2000–2016)"), + ("BEF", "Belgian Franc"), + ("BEC", "Belgian Franc (convertible)"), + ("BEL", "Belgian Franc (financial)"), + ("BZD", "Belize Dollar"), + ("BMD", "Bermudan Dollar"), + ("BTN", "Bhutanese Ngultrum"), + ("BOB", "Bolivian Boliviano"), + ("BOL", "Bolivian Boliviano (1863–1963)"), + ("BOV", "Bolivian Mvdol"), + ("BOP", "Bolivian Peso"), + ("BAM", "Bosnia-Herzegovina Convertible Mark"), + ("BAD", "Bosnia-Herzegovina Dinar (1992–1994)"), + ("BAN", "Bosnia-Herzegovina New Dinar (1994–1997)"), + ("BWP", "Botswanan Pula"), + ("BRC", "Brazilian Cruzado (1986–1989)"), + ("BRZ", "Brazilian Cruzeiro (1942–1967)"), + ("BRE", "Brazilian Cruzeiro (1990–1993)"), + ("BRR", "Brazilian Cruzeiro (1993–1994)"), + ("BRN", "Brazilian New Cruzado (1989–1990)"), + ("BRB", "Brazilian New Cruzeiro (1967–1986)"), + ("BRL", "Brazilian Real"), + ("GBP", "British Pound"), + ("BND", "Brunei Dollar"), + ("BGL", "Bulgarian Hard Lev"), + ("BGN", "Bulgarian Lev"), + ("BGO", "Bulgarian Lev (1879–1952)"), + ("BGM", "Bulgarian Socialist Lev"), + ("BUK", "Burmese Kyat"), + ("BIF", "Burundian Franc"), + ("XPF", "CFP Franc"), + ("KHR", "Cambodian Riel"), + ("CAD", "Canadian Dollar"), + ("CVE", "Cape Verdean Escudo"), + ("KYD", "Cayman Islands Dollar"), + ("XAF", "Central African CFA Franc"), + ("CLE", "Chilean Escudo"), + ("CLP", "Chilean Peso"), + ("CLF", "Chilean Unit of Account (UF)"), + ("CNX", "Chinese People’s Bank Dollar"), + ("CNY", "Chinese Yuan"), + ("CNH", "Chinese Yuan (offshore)"), + ("COP", "Colombian Peso"), + ("COU", "Colombian Real Value Unit"), + ("KMF", "Comorian Franc"), + ("CDF", "Congolese Franc"), + ("CRC", "Costa Rican Colón"), + ("HRD", "Croatian Dinar"), + ("HRK", "Croatian Kuna"), + ("CUC", "Cuban Convertible Peso"), + ("CUP", "Cuban Peso"), + ("CYP", "Cypriot Pound"), + ("CZK", "Czech Koruna"), + ("CSK", "Czechoslovak Hard Koruna"), + ("DKK", "Danish Krone"), + ("DJF", "Djiboutian Franc"), + ("DOP", "Dominican Peso"), + ("NLG", "Dutch Guilder"), + ("XCD", "East Caribbean Dollar"), + ("DDM", "East German Mark"), + ("ECS", "Ecuadorian Sucre"), + ("ECV", "Ecuadorian Unit of Constant Value"), + ("EGP", "Egyptian Pound"), + ("GQE", "Equatorial Guinean Ekwele"), + ("ERN", "Eritrean Nakfa"), + ("EEK", "Estonian Kroon"), + ("ETB", "Ethiopian Birr"), + ("EUR", "Euro"), + ("XBA", "European Composite Unit"), + ("XEU", "European Currency Unit"), + ("XBB", "European Monetary Unit"), + ("XBC", "European Unit of Account (XBC)"), + ("XBD", "European Unit of Account (XBD)"), + ("FKP", "Falkland Islands Pound"), + ("FJD", "Fijian Dollar"), + ("FIM", "Finnish Markka"), + ("FRF", "French Franc"), + ("XFO", "French Gold Franc"), + ("XFU", "French UIC-Franc"), + ("GMD", "Gambian Dalasi"), + ("GEK", "Georgian Kupon Larit"), + ("GEL", "Georgian Lari"), + ("DEM", "German Mark"), + ("GHS", "Ghanaian Cedi"), + ("GHC", "Ghanaian Cedi (1979–2007)"), + ("GIP", "Gibraltar Pound"), + ("XAU", "Gold"), + ("GRD", "Greek Drachma"), + ("GTQ", "Guatemalan Quetzal"), + ("GWP", "Guinea-Bissau Peso"), + ("GNF", "Guinean Franc"), + ("GNS", "Guinean Syli"), + ("GYD", "Guyanaese Dollar"), + ("HTG", "Haitian Gourde"), + ("HNL", "Honduran Lempira"), + ("HKD", "Hong Kong Dollar"), + ("HUF", "Hungarian Forint"), + ("IMP", "IMP"), + ("ISK", "Icelandic Króna"), + ("ISJ", "Icelandic Króna (1918–1981)"), + ("INR", "Indian Rupee"), + ("IDR", "Indonesian Rupiah"), + ("IRR", "Iranian Rial"), + ("IQD", "Iraqi Dinar"), + ("IEP", "Irish Pound"), + ("ILS", "Israeli New Shekel"), + ("ILP", "Israeli Pound"), + ("ILR", "Israeli Shekel (1980–1985)"), + ("ITL", "Italian Lira"), + ("JMD", "Jamaican Dollar"), + ("JPY", "Japanese Yen"), + ("JOD", "Jordanian Dinar"), + ("KZT", "Kazakhstani Tenge"), + ("KES", "Kenyan Shilling"), + ("KWD", "Kuwaiti Dinar"), + ("KGS", "Kyrgystani Som"), + ("LAK", "Laotian Kip"), + ("LVL", "Latvian Lats"), + ("LVR", "Latvian Ruble"), + ("LBP", "Lebanese Pound"), + ("LSL", "Lesotho Loti"), + ("LRD", "Liberian Dollar"), + ("LYD", "Libyan Dinar"), + ("LTL", "Lithuanian Litas"), + ("LTT", "Lithuanian Talonas"), + ("LUL", "Luxembourg Financial Franc"), + ("LUC", "Luxembourgian Convertible Franc"), + ("LUF", "Luxembourgian Franc"), + ("MOP", "Macanese Pataca"), + ("MKD", "Macedonian Denar"), + ("MKN", "Macedonian Denar (1992–1993)"), + ("MGA", "Malagasy Ariary"), + ("MGF", "Malagasy Franc"), + ("MWK", "Malawian Kwacha"), + ("MYR", "Malaysian Ringgit"), + ("MVR", "Maldivian Rufiyaa"), + ("MVP", "Maldivian Rupee (1947–1981)"), + ("MLF", "Malian Franc"), + ("MTL", "Maltese Lira"), + ("MTP", "Maltese Pound"), + ("MRU", "Mauritanian Ouguiya"), + ("MRO", "Mauritanian Ouguiya (1973–2017)"), + ("MUR", "Mauritian Rupee"), + ("MXV", "Mexican Investment Unit"), + ("MXN", "Mexican Peso"), + ("MXP", "Mexican Silver Peso (1861–1992)"), + ("MDC", "Moldovan Cupon"), + ("MDL", "Moldovan Leu"), + ("MCF", "Monegasque Franc"), + ("MNT", "Mongolian Tugrik"), + ("MAD", "Moroccan Dirham"), + ("MAF", "Moroccan Franc"), + ("MZE", "Mozambican Escudo"), + ("MZN", "Mozambican Metical"), + ("MZM", "Mozambican Metical (1980–2006)"), + ("MMK", "Myanmar Kyat"), + ("NAD", "Namibian Dollar"), + ("NPR", "Nepalese Rupee"), + ("ANG", "Netherlands Antillean Guilder"), + ("TWD", "New Taiwan Dollar"), + ("NZD", "New Zealand Dollar"), + ("NIO", "Nicaraguan Córdoba"), + ("NIC", "Nicaraguan Córdoba (1988–1991)"), + ("NGN", "Nigerian Naira"), + ("KPW", "North Korean Won"), + ("NOK", "Norwegian Krone"), + ("OMR", "Omani Rial"), + ("PKR", "Pakistani Rupee"), + ("XPD", "Palladium"), + ("PAB", "Panamanian Balboa"), + ("PGK", "Papua New Guinean Kina"), + ("PYG", "Paraguayan Guarani"), + ("PEI", "Peruvian Inti"), + ("PEN", "Peruvian Sol"), + ("PES", "Peruvian Sol (1863–1965)"), + ("PHP", "Philippine Peso"), + ("XPT", "Platinum"), + ("PLN", "Polish Zloty"), + ("PLZ", "Polish Zloty (1950–1995)"), + ("PTE", "Portuguese Escudo"), + ("GWE", "Portuguese Guinea Escudo"), + ("QAR", "Qatari Riyal"), + ("XRE", "RINET Funds"), + ("RHD", "Rhodesian Dollar"), + ("RON", "Romanian Leu"), + ("ROL", "Romanian Leu (1952–2006)"), + ("RUB", "Russian Ruble"), + ("RUR", "Russian Ruble (1991–1998)"), + ("RWF", "Rwandan Franc"), + ("SVC", "Salvadoran Colón"), + ("WST", "Samoan Tala"), + ("SAR", "Saudi Riyal"), + ("RSD", "Serbian Dinar"), + ("CSD", "Serbian Dinar (2002–2006)"), + ("SCR", "Seychellois Rupee"), + ("SLL", "Sierra Leonean Leone (1964—2022)"), + ("XAG", "Silver"), + ("SGD", "Singapore Dollar"), + ("SKK", "Slovak Koruna"), + ("SIT", "Slovenian Tolar"), + ("SBD", "Solomon Islands Dollar"), + ("SOS", "Somali Shilling"), + ("ZAR", "South African Rand"), + ("ZAL", "South African Rand (financial)"), + ("KRH", "South Korean Hwan (1953–1962)"), + ("KRW", "South Korean Won"), + ("KRO", "South Korean Won (1945–1953)"), + ("SSP", "South Sudanese Pound"), + ("SUR", "Soviet Rouble"), + ("ESP", "Spanish Peseta"), + ("ESA", "Spanish Peseta (A account)"), + ("ESB", "Spanish Peseta (convertible account)"), + ("XDR", "Special Drawing Rights"), + ("LKR", "Sri Lankan Rupee"), + ("SHP", "St. Helena Pound"), + ("XSU", "Sucre"), + ("SDD", "Sudanese Dinar (1992–2007)"), + ("SDG", "Sudanese Pound"), + ("SDP", "Sudanese Pound (1957–1998)"), + ("SRD", "Surinamese Dollar"), + ("SRG", "Surinamese Guilder"), + ("SZL", "Swazi Lilangeni"), + ("SEK", "Swedish Krona"), + ("CHF", "Swiss Franc"), + ("SYP", "Syrian Pound"), + ("STN", "São Tomé & Príncipe Dobra"), + ("STD", "São Tomé & Príncipe Dobra (1977–2017)"), + ("TVD", "TVD"), + ("TJR", "Tajikistani Ruble"), + ("TJS", "Tajikistani Somoni"), + ("TZS", "Tanzanian Shilling"), + ("XTS", "Testing Currency Code"), + ("THB", "Thai Baht"), + ( + "XXX", + "The codes assigned for transactions where no currency is involved", + ), + ("TPE", "Timorese Escudo"), + ("TOP", "Tongan Paʻanga"), + ("TTD", "Trinidad & Tobago Dollar"), + ("TND", "Tunisian Dinar"), + ("TRY", "Turkish Lira"), + ("TRL", "Turkish Lira (1922–2005)"), + ("TMT", "Turkmenistani Manat"), + ("TMM", "Turkmenistani Manat (1993–2009)"), + ("USD", "US Dollar"), + ("USN", "US Dollar (Next day)"), + ("USS", "US Dollar (Same day)"), + ("UGX", "Ugandan Shilling"), + ("UGS", "Ugandan Shilling (1966–1987)"), + ("UAH", "Ukrainian Hryvnia"), + ("UAK", "Ukrainian Karbovanets"), + ("AED", "United Arab Emirates Dirham"), + ("UYW", "Uruguayan Nominal Wage Index Unit"), + ("UYU", "Uruguayan Peso"), + ("UYP", "Uruguayan Peso (1975–1993)"), + ("UYI", "Uruguayan Peso (Indexed Units)"), + ("UZS", "Uzbekistani Som"), + ("VUV", "Vanuatu Vatu"), + ("VES", "Venezuelan Bolívar"), + ("VEB", "Venezuelan Bolívar (1871–2008)"), + ("VEF", "Venezuelan Bolívar (2008–2018)"), + ("VND", "Vietnamese Dong"), + ("VNN", "Vietnamese Dong (1978–1985)"), + ("CHE", "WIR Euro"), + ("CHW", "WIR Franc"), + ("XOF", "West African CFA Franc"), + ("YDD", "Yemeni Dinar"), + ("YER", "Yemeni Rial"), + ("YUN", "Yugoslavian Convertible Dinar (1990–1992)"), + ("YUD", "Yugoslavian Hard Dinar (1966–1990)"), + ("YUM", "Yugoslavian New Dinar (1994–2002)"), + ("YUR", "Yugoslavian Reformed Dinar (1992–1993)"), + ("ZWN", "ZWN"), + ("ZRN", "Zairean New Zaire (1993–1998)"), + ("ZRZ", "Zairean Zaire (1971–1993)"), + ("ZMW", "Zambian Kwacha"), + ("ZMK", "Zambian Kwacha (1968–2012)"), + ("ZWD", "Zimbabwean Dollar (1980–2008)"), + ("ZWR", "Zimbabwean Dollar (2008)"), + ("ZWL", "Zimbabwean Dollar (2009)"), + ], + default="CHF", + editable=False, + max_length=3, + null=True, + ), + ), + migrations.AlterField( + model_name="pricing", + name="min_price_currency", + field=djmoney.models.fields.CurrencyField( + choices=[ + ("XUA", "ADB Unit of Account"), + ("AFN", "Afghan Afghani"), + ("AFA", "Afghan Afghani (1927–2002)"), + ("ALL", "Albanian Lek"), + ("ALK", "Albanian Lek (1946–1965)"), + ("DZD", "Algerian Dinar"), + ("ADP", "Andorran Peseta"), + ("AOA", "Angolan Kwanza"), + ("AOK", "Angolan Kwanza (1977–1991)"), + ("AON", "Angolan New Kwanza (1990–2000)"), + ("AOR", "Angolan Readjusted Kwanza (1995–1999)"), + ("ARA", "Argentine Austral"), + ("ARS", "Argentine Peso"), + ("ARM", "Argentine Peso (1881–1970)"), + ("ARP", "Argentine Peso (1983–1985)"), + ("ARL", "Argentine Peso Ley (1970–1983)"), + ("AMD", "Armenian Dram"), + ("AWG", "Aruban Florin"), + ("AUD", "Australian Dollar"), + ("ATS", "Austrian Schilling"), + ("AZN", "Azerbaijani Manat"), + ("AZM", "Azerbaijani Manat (1993–2006)"), + ("BSD", "Bahamian Dollar"), + ("BHD", "Bahraini Dinar"), + ("BDT", "Bangladeshi Taka"), + ("BBD", "Barbadian Dollar"), + ("BYN", "Belarusian Ruble"), + ("BYB", "Belarusian Ruble (1994–1999)"), + ("BYR", "Belarusian Ruble (2000–2016)"), + ("BEF", "Belgian Franc"), + ("BEC", "Belgian Franc (convertible)"), + ("BEL", "Belgian Franc (financial)"), + ("BZD", "Belize Dollar"), + ("BMD", "Bermudan Dollar"), + ("BTN", "Bhutanese Ngultrum"), + ("BOB", "Bolivian Boliviano"), + ("BOL", "Bolivian Boliviano (1863–1963)"), + ("BOV", "Bolivian Mvdol"), + ("BOP", "Bolivian Peso"), + ("BAM", "Bosnia-Herzegovina Convertible Mark"), + ("BAD", "Bosnia-Herzegovina Dinar (1992–1994)"), + ("BAN", "Bosnia-Herzegovina New Dinar (1994–1997)"), + ("BWP", "Botswanan Pula"), + ("BRC", "Brazilian Cruzado (1986–1989)"), + ("BRZ", "Brazilian Cruzeiro (1942–1967)"), + ("BRE", "Brazilian Cruzeiro (1990–1993)"), + ("BRR", "Brazilian Cruzeiro (1993–1994)"), + ("BRN", "Brazilian New Cruzado (1989–1990)"), + ("BRB", "Brazilian New Cruzeiro (1967–1986)"), + ("BRL", "Brazilian Real"), + ("GBP", "British Pound"), + ("BND", "Brunei Dollar"), + ("BGL", "Bulgarian Hard Lev"), + ("BGN", "Bulgarian Lev"), + ("BGO", "Bulgarian Lev (1879–1952)"), + ("BGM", "Bulgarian Socialist Lev"), + ("BUK", "Burmese Kyat"), + ("BIF", "Burundian Franc"), + ("XPF", "CFP Franc"), + ("KHR", "Cambodian Riel"), + ("CAD", "Canadian Dollar"), + ("CVE", "Cape Verdean Escudo"), + ("KYD", "Cayman Islands Dollar"), + ("XAF", "Central African CFA Franc"), + ("CLE", "Chilean Escudo"), + ("CLP", "Chilean Peso"), + ("CLF", "Chilean Unit of Account (UF)"), + ("CNX", "Chinese People’s Bank Dollar"), + ("CNY", "Chinese Yuan"), + ("CNH", "Chinese Yuan (offshore)"), + ("COP", "Colombian Peso"), + ("COU", "Colombian Real Value Unit"), + ("KMF", "Comorian Franc"), + ("CDF", "Congolese Franc"), + ("CRC", "Costa Rican Colón"), + ("HRD", "Croatian Dinar"), + ("HRK", "Croatian Kuna"), + ("CUC", "Cuban Convertible Peso"), + ("CUP", "Cuban Peso"), + ("CYP", "Cypriot Pound"), + ("CZK", "Czech Koruna"), + ("CSK", "Czechoslovak Hard Koruna"), + ("DKK", "Danish Krone"), + ("DJF", "Djiboutian Franc"), + ("DOP", "Dominican Peso"), + ("NLG", "Dutch Guilder"), + ("XCD", "East Caribbean Dollar"), + ("DDM", "East German Mark"), + ("ECS", "Ecuadorian Sucre"), + ("ECV", "Ecuadorian Unit of Constant Value"), + ("EGP", "Egyptian Pound"), + ("GQE", "Equatorial Guinean Ekwele"), + ("ERN", "Eritrean Nakfa"), + ("EEK", "Estonian Kroon"), + ("ETB", "Ethiopian Birr"), + ("EUR", "Euro"), + ("XBA", "European Composite Unit"), + ("XEU", "European Currency Unit"), + ("XBB", "European Monetary Unit"), + ("XBC", "European Unit of Account (XBC)"), + ("XBD", "European Unit of Account (XBD)"), + ("FKP", "Falkland Islands Pound"), + ("FJD", "Fijian Dollar"), + ("FIM", "Finnish Markka"), + ("FRF", "French Franc"), + ("XFO", "French Gold Franc"), + ("XFU", "French UIC-Franc"), + ("GMD", "Gambian Dalasi"), + ("GEK", "Georgian Kupon Larit"), + ("GEL", "Georgian Lari"), + ("DEM", "German Mark"), + ("GHS", "Ghanaian Cedi"), + ("GHC", "Ghanaian Cedi (1979–2007)"), + ("GIP", "Gibraltar Pound"), + ("XAU", "Gold"), + ("GRD", "Greek Drachma"), + ("GTQ", "Guatemalan Quetzal"), + ("GWP", "Guinea-Bissau Peso"), + ("GNF", "Guinean Franc"), + ("GNS", "Guinean Syli"), + ("GYD", "Guyanaese Dollar"), + ("HTG", "Haitian Gourde"), + ("HNL", "Honduran Lempira"), + ("HKD", "Hong Kong Dollar"), + ("HUF", "Hungarian Forint"), + ("IMP", "IMP"), + ("ISK", "Icelandic Króna"), + ("ISJ", "Icelandic Króna (1918–1981)"), + ("INR", "Indian Rupee"), + ("IDR", "Indonesian Rupiah"), + ("IRR", "Iranian Rial"), + ("IQD", "Iraqi Dinar"), + ("IEP", "Irish Pound"), + ("ILS", "Israeli New Shekel"), + ("ILP", "Israeli Pound"), + ("ILR", "Israeli Shekel (1980–1985)"), + ("ITL", "Italian Lira"), + ("JMD", "Jamaican Dollar"), + ("JPY", "Japanese Yen"), + ("JOD", "Jordanian Dinar"), + ("KZT", "Kazakhstani Tenge"), + ("KES", "Kenyan Shilling"), + ("KWD", "Kuwaiti Dinar"), + ("KGS", "Kyrgystani Som"), + ("LAK", "Laotian Kip"), + ("LVL", "Latvian Lats"), + ("LVR", "Latvian Ruble"), + ("LBP", "Lebanese Pound"), + ("LSL", "Lesotho Loti"), + ("LRD", "Liberian Dollar"), + ("LYD", "Libyan Dinar"), + ("LTL", "Lithuanian Litas"), + ("LTT", "Lithuanian Talonas"), + ("LUL", "Luxembourg Financial Franc"), + ("LUC", "Luxembourgian Convertible Franc"), + ("LUF", "Luxembourgian Franc"), + ("MOP", "Macanese Pataca"), + ("MKD", "Macedonian Denar"), + ("MKN", "Macedonian Denar (1992–1993)"), + ("MGA", "Malagasy Ariary"), + ("MGF", "Malagasy Franc"), + ("MWK", "Malawian Kwacha"), + ("MYR", "Malaysian Ringgit"), + ("MVR", "Maldivian Rufiyaa"), + ("MVP", "Maldivian Rupee (1947–1981)"), + ("MLF", "Malian Franc"), + ("MTL", "Maltese Lira"), + ("MTP", "Maltese Pound"), + ("MRU", "Mauritanian Ouguiya"), + ("MRO", "Mauritanian Ouguiya (1973–2017)"), + ("MUR", "Mauritian Rupee"), + ("MXV", "Mexican Investment Unit"), + ("MXN", "Mexican Peso"), + ("MXP", "Mexican Silver Peso (1861–1992)"), + ("MDC", "Moldovan Cupon"), + ("MDL", "Moldovan Leu"), + ("MCF", "Monegasque Franc"), + ("MNT", "Mongolian Tugrik"), + ("MAD", "Moroccan Dirham"), + ("MAF", "Moroccan Franc"), + ("MZE", "Mozambican Escudo"), + ("MZN", "Mozambican Metical"), + ("MZM", "Mozambican Metical (1980–2006)"), + ("MMK", "Myanmar Kyat"), + ("NAD", "Namibian Dollar"), + ("NPR", "Nepalese Rupee"), + ("ANG", "Netherlands Antillean Guilder"), + ("TWD", "New Taiwan Dollar"), + ("NZD", "New Zealand Dollar"), + ("NIO", "Nicaraguan Córdoba"), + ("NIC", "Nicaraguan Córdoba (1988–1991)"), + ("NGN", "Nigerian Naira"), + ("KPW", "North Korean Won"), + ("NOK", "Norwegian Krone"), + ("OMR", "Omani Rial"), + ("PKR", "Pakistani Rupee"), + ("XPD", "Palladium"), + ("PAB", "Panamanian Balboa"), + ("PGK", "Papua New Guinean Kina"), + ("PYG", "Paraguayan Guarani"), + ("PEI", "Peruvian Inti"), + ("PEN", "Peruvian Sol"), + ("PES", "Peruvian Sol (1863–1965)"), + ("PHP", "Philippine Peso"), + ("XPT", "Platinum"), + ("PLN", "Polish Zloty"), + ("PLZ", "Polish Zloty (1950–1995)"), + ("PTE", "Portuguese Escudo"), + ("GWE", "Portuguese Guinea Escudo"), + ("QAR", "Qatari Riyal"), + ("XRE", "RINET Funds"), + ("RHD", "Rhodesian Dollar"), + ("RON", "Romanian Leu"), + ("ROL", "Romanian Leu (1952–2006)"), + ("RUB", "Russian Ruble"), + ("RUR", "Russian Ruble (1991–1998)"), + ("RWF", "Rwandan Franc"), + ("SVC", "Salvadoran Colón"), + ("WST", "Samoan Tala"), + ("SAR", "Saudi Riyal"), + ("RSD", "Serbian Dinar"), + ("CSD", "Serbian Dinar (2002–2006)"), + ("SCR", "Seychellois Rupee"), + ("SLL", "Sierra Leonean Leone (1964—2022)"), + ("XAG", "Silver"), + ("SGD", "Singapore Dollar"), + ("SKK", "Slovak Koruna"), + ("SIT", "Slovenian Tolar"), + ("SBD", "Solomon Islands Dollar"), + ("SOS", "Somali Shilling"), + ("ZAR", "South African Rand"), + ("ZAL", "South African Rand (financial)"), + ("KRH", "South Korean Hwan (1953–1962)"), + ("KRW", "South Korean Won"), + ("KRO", "South Korean Won (1945–1953)"), + ("SSP", "South Sudanese Pound"), + ("SUR", "Soviet Rouble"), + ("ESP", "Spanish Peseta"), + ("ESA", "Spanish Peseta (A account)"), + ("ESB", "Spanish Peseta (convertible account)"), + ("XDR", "Special Drawing Rights"), + ("LKR", "Sri Lankan Rupee"), + ("SHP", "St. Helena Pound"), + ("XSU", "Sucre"), + ("SDD", "Sudanese Dinar (1992–2007)"), + ("SDG", "Sudanese Pound"), + ("SDP", "Sudanese Pound (1957–1998)"), + ("SRD", "Surinamese Dollar"), + ("SRG", "Surinamese Guilder"), + ("SZL", "Swazi Lilangeni"), + ("SEK", "Swedish Krona"), + ("CHF", "Swiss Franc"), + ("SYP", "Syrian Pound"), + ("STN", "São Tomé & Príncipe Dobra"), + ("STD", "São Tomé & Príncipe Dobra (1977–2017)"), + ("TVD", "TVD"), + ("TJR", "Tajikistani Ruble"), + ("TJS", "Tajikistani Somoni"), + ("TZS", "Tanzanian Shilling"), + ("XTS", "Testing Currency Code"), + ("THB", "Thai Baht"), + ( + "XXX", + "The codes assigned for transactions where no currency is involved", + ), + ("TPE", "Timorese Escudo"), + ("TOP", "Tongan Paʻanga"), + ("TTD", "Trinidad & Tobago Dollar"), + ("TND", "Tunisian Dinar"), + ("TRY", "Turkish Lira"), + ("TRL", "Turkish Lira (1922–2005)"), + ("TMT", "Turkmenistani Manat"), + ("TMM", "Turkmenistani Manat (1993–2009)"), + ("USD", "US Dollar"), + ("USN", "US Dollar (Next day)"), + ("USS", "US Dollar (Same day)"), + ("UGX", "Ugandan Shilling"), + ("UGS", "Ugandan Shilling (1966–1987)"), + ("UAH", "Ukrainian Hryvnia"), + ("UAK", "Ukrainian Karbovanets"), + ("AED", "United Arab Emirates Dirham"), + ("UYW", "Uruguayan Nominal Wage Index Unit"), + ("UYU", "Uruguayan Peso"), + ("UYP", "Uruguayan Peso (1975–1993)"), + ("UYI", "Uruguayan Peso (Indexed Units)"), + ("UZS", "Uzbekistani Som"), + ("VUV", "Vanuatu Vatu"), + ("VES", "Venezuelan Bolívar"), + ("VEB", "Venezuelan Bolívar (1871–2008)"), + ("VEF", "Venezuelan Bolívar (2008–2018)"), + ("VND", "Vietnamese Dong"), + ("VNN", "Vietnamese Dong (1978–1985)"), + ("CHE", "WIR Euro"), + ("CHW", "WIR Franc"), + ("XOF", "West African CFA Franc"), + ("YDD", "Yemeni Dinar"), + ("YER", "Yemeni Rial"), + ("YUN", "Yugoslavian Convertible Dinar (1990–1992)"), + ("YUD", "Yugoslavian Hard Dinar (1966–1990)"), + ("YUM", "Yugoslavian New Dinar (1994–2002)"), + ("YUR", "Yugoslavian Reformed Dinar (1992–1993)"), + ("ZWN", "ZWN"), + ("ZRN", "Zairean New Zaire (1993–1998)"), + ("ZRZ", "Zairean Zaire (1971–1993)"), + ("ZMW", "Zambian Kwacha"), + ("ZMK", "Zambian Kwacha (1968–2012)"), + ("ZWD", "Zimbabwean Dollar (1980–2008)"), + ("ZWR", "Zimbabwean Dollar (2008)"), + ("ZWL", "Zimbabwean Dollar (2009)"), + ], + default="CHF", + editable=False, + max_length=3, + null=True, + ), + ), + migrations.AlterField( + model_name="pricing", + name="unit_price_currency", + field=djmoney.models.fields.CurrencyField( + choices=[ + ("XUA", "ADB Unit of Account"), + ("AFN", "Afghan Afghani"), + ("AFA", "Afghan Afghani (1927–2002)"), + ("ALL", "Albanian Lek"), + ("ALK", "Albanian Lek (1946–1965)"), + ("DZD", "Algerian Dinar"), + ("ADP", "Andorran Peseta"), + ("AOA", "Angolan Kwanza"), + ("AOK", "Angolan Kwanza (1977–1991)"), + ("AON", "Angolan New Kwanza (1990–2000)"), + ("AOR", "Angolan Readjusted Kwanza (1995–1999)"), + ("ARA", "Argentine Austral"), + ("ARS", "Argentine Peso"), + ("ARM", "Argentine Peso (1881–1970)"), + ("ARP", "Argentine Peso (1983–1985)"), + ("ARL", "Argentine Peso Ley (1970–1983)"), + ("AMD", "Armenian Dram"), + ("AWG", "Aruban Florin"), + ("AUD", "Australian Dollar"), + ("ATS", "Austrian Schilling"), + ("AZN", "Azerbaijani Manat"), + ("AZM", "Azerbaijani Manat (1993–2006)"), + ("BSD", "Bahamian Dollar"), + ("BHD", "Bahraini Dinar"), + ("BDT", "Bangladeshi Taka"), + ("BBD", "Barbadian Dollar"), + ("BYN", "Belarusian Ruble"), + ("BYB", "Belarusian Ruble (1994–1999)"), + ("BYR", "Belarusian Ruble (2000–2016)"), + ("BEF", "Belgian Franc"), + ("BEC", "Belgian Franc (convertible)"), + ("BEL", "Belgian Franc (financial)"), + ("BZD", "Belize Dollar"), + ("BMD", "Bermudan Dollar"), + ("BTN", "Bhutanese Ngultrum"), + ("BOB", "Bolivian Boliviano"), + ("BOL", "Bolivian Boliviano (1863–1963)"), + ("BOV", "Bolivian Mvdol"), + ("BOP", "Bolivian Peso"), + ("BAM", "Bosnia-Herzegovina Convertible Mark"), + ("BAD", "Bosnia-Herzegovina Dinar (1992–1994)"), + ("BAN", "Bosnia-Herzegovina New Dinar (1994–1997)"), + ("BWP", "Botswanan Pula"), + ("BRC", "Brazilian Cruzado (1986–1989)"), + ("BRZ", "Brazilian Cruzeiro (1942–1967)"), + ("BRE", "Brazilian Cruzeiro (1990–1993)"), + ("BRR", "Brazilian Cruzeiro (1993–1994)"), + ("BRN", "Brazilian New Cruzado (1989–1990)"), + ("BRB", "Brazilian New Cruzeiro (1967–1986)"), + ("BRL", "Brazilian Real"), + ("GBP", "British Pound"), + ("BND", "Brunei Dollar"), + ("BGL", "Bulgarian Hard Lev"), + ("BGN", "Bulgarian Lev"), + ("BGO", "Bulgarian Lev (1879–1952)"), + ("BGM", "Bulgarian Socialist Lev"), + ("BUK", "Burmese Kyat"), + ("BIF", "Burundian Franc"), + ("XPF", "CFP Franc"), + ("KHR", "Cambodian Riel"), + ("CAD", "Canadian Dollar"), + ("CVE", "Cape Verdean Escudo"), + ("KYD", "Cayman Islands Dollar"), + ("XAF", "Central African CFA Franc"), + ("CLE", "Chilean Escudo"), + ("CLP", "Chilean Peso"), + ("CLF", "Chilean Unit of Account (UF)"), + ("CNX", "Chinese People’s Bank Dollar"), + ("CNY", "Chinese Yuan"), + ("CNH", "Chinese Yuan (offshore)"), + ("COP", "Colombian Peso"), + ("COU", "Colombian Real Value Unit"), + ("KMF", "Comorian Franc"), + ("CDF", "Congolese Franc"), + ("CRC", "Costa Rican Colón"), + ("HRD", "Croatian Dinar"), + ("HRK", "Croatian Kuna"), + ("CUC", "Cuban Convertible Peso"), + ("CUP", "Cuban Peso"), + ("CYP", "Cypriot Pound"), + ("CZK", "Czech Koruna"), + ("CSK", "Czechoslovak Hard Koruna"), + ("DKK", "Danish Krone"), + ("DJF", "Djiboutian Franc"), + ("DOP", "Dominican Peso"), + ("NLG", "Dutch Guilder"), + ("XCD", "East Caribbean Dollar"), + ("DDM", "East German Mark"), + ("ECS", "Ecuadorian Sucre"), + ("ECV", "Ecuadorian Unit of Constant Value"), + ("EGP", "Egyptian Pound"), + ("GQE", "Equatorial Guinean Ekwele"), + ("ERN", "Eritrean Nakfa"), + ("EEK", "Estonian Kroon"), + ("ETB", "Ethiopian Birr"), + ("EUR", "Euro"), + ("XBA", "European Composite Unit"), + ("XEU", "European Currency Unit"), + ("XBB", "European Monetary Unit"), + ("XBC", "European Unit of Account (XBC)"), + ("XBD", "European Unit of Account (XBD)"), + ("FKP", "Falkland Islands Pound"), + ("FJD", "Fijian Dollar"), + ("FIM", "Finnish Markka"), + ("FRF", "French Franc"), + ("XFO", "French Gold Franc"), + ("XFU", "French UIC-Franc"), + ("GMD", "Gambian Dalasi"), + ("GEK", "Georgian Kupon Larit"), + ("GEL", "Georgian Lari"), + ("DEM", "German Mark"), + ("GHS", "Ghanaian Cedi"), + ("GHC", "Ghanaian Cedi (1979–2007)"), + ("GIP", "Gibraltar Pound"), + ("XAU", "Gold"), + ("GRD", "Greek Drachma"), + ("GTQ", "Guatemalan Quetzal"), + ("GWP", "Guinea-Bissau Peso"), + ("GNF", "Guinean Franc"), + ("GNS", "Guinean Syli"), + ("GYD", "Guyanaese Dollar"), + ("HTG", "Haitian Gourde"), + ("HNL", "Honduran Lempira"), + ("HKD", "Hong Kong Dollar"), + ("HUF", "Hungarian Forint"), + ("IMP", "IMP"), + ("ISK", "Icelandic Króna"), + ("ISJ", "Icelandic Króna (1918–1981)"), + ("INR", "Indian Rupee"), + ("IDR", "Indonesian Rupiah"), + ("IRR", "Iranian Rial"), + ("IQD", "Iraqi Dinar"), + ("IEP", "Irish Pound"), + ("ILS", "Israeli New Shekel"), + ("ILP", "Israeli Pound"), + ("ILR", "Israeli Shekel (1980–1985)"), + ("ITL", "Italian Lira"), + ("JMD", "Jamaican Dollar"), + ("JPY", "Japanese Yen"), + ("JOD", "Jordanian Dinar"), + ("KZT", "Kazakhstani Tenge"), + ("KES", "Kenyan Shilling"), + ("KWD", "Kuwaiti Dinar"), + ("KGS", "Kyrgystani Som"), + ("LAK", "Laotian Kip"), + ("LVL", "Latvian Lats"), + ("LVR", "Latvian Ruble"), + ("LBP", "Lebanese Pound"), + ("LSL", "Lesotho Loti"), + ("LRD", "Liberian Dollar"), + ("LYD", "Libyan Dinar"), + ("LTL", "Lithuanian Litas"), + ("LTT", "Lithuanian Talonas"), + ("LUL", "Luxembourg Financial Franc"), + ("LUC", "Luxembourgian Convertible Franc"), + ("LUF", "Luxembourgian Franc"), + ("MOP", "Macanese Pataca"), + ("MKD", "Macedonian Denar"), + ("MKN", "Macedonian Denar (1992–1993)"), + ("MGA", "Malagasy Ariary"), + ("MGF", "Malagasy Franc"), + ("MWK", "Malawian Kwacha"), + ("MYR", "Malaysian Ringgit"), + ("MVR", "Maldivian Rufiyaa"), + ("MVP", "Maldivian Rupee (1947–1981)"), + ("MLF", "Malian Franc"), + ("MTL", "Maltese Lira"), + ("MTP", "Maltese Pound"), + ("MRU", "Mauritanian Ouguiya"), + ("MRO", "Mauritanian Ouguiya (1973–2017)"), + ("MUR", "Mauritian Rupee"), + ("MXV", "Mexican Investment Unit"), + ("MXN", "Mexican Peso"), + ("MXP", "Mexican Silver Peso (1861–1992)"), + ("MDC", "Moldovan Cupon"), + ("MDL", "Moldovan Leu"), + ("MCF", "Monegasque Franc"), + ("MNT", "Mongolian Tugrik"), + ("MAD", "Moroccan Dirham"), + ("MAF", "Moroccan Franc"), + ("MZE", "Mozambican Escudo"), + ("MZN", "Mozambican Metical"), + ("MZM", "Mozambican Metical (1980–2006)"), + ("MMK", "Myanmar Kyat"), + ("NAD", "Namibian Dollar"), + ("NPR", "Nepalese Rupee"), + ("ANG", "Netherlands Antillean Guilder"), + ("TWD", "New Taiwan Dollar"), + ("NZD", "New Zealand Dollar"), + ("NIO", "Nicaraguan Córdoba"), + ("NIC", "Nicaraguan Córdoba (1988–1991)"), + ("NGN", "Nigerian Naira"), + ("KPW", "North Korean Won"), + ("NOK", "Norwegian Krone"), + ("OMR", "Omani Rial"), + ("PKR", "Pakistani Rupee"), + ("XPD", "Palladium"), + ("PAB", "Panamanian Balboa"), + ("PGK", "Papua New Guinean Kina"), + ("PYG", "Paraguayan Guarani"), + ("PEI", "Peruvian Inti"), + ("PEN", "Peruvian Sol"), + ("PES", "Peruvian Sol (1863–1965)"), + ("PHP", "Philippine Peso"), + ("XPT", "Platinum"), + ("PLN", "Polish Zloty"), + ("PLZ", "Polish Zloty (1950–1995)"), + ("PTE", "Portuguese Escudo"), + ("GWE", "Portuguese Guinea Escudo"), + ("QAR", "Qatari Riyal"), + ("XRE", "RINET Funds"), + ("RHD", "Rhodesian Dollar"), + ("RON", "Romanian Leu"), + ("ROL", "Romanian Leu (1952–2006)"), + ("RUB", "Russian Ruble"), + ("RUR", "Russian Ruble (1991–1998)"), + ("RWF", "Rwandan Franc"), + ("SVC", "Salvadoran Colón"), + ("WST", "Samoan Tala"), + ("SAR", "Saudi Riyal"), + ("RSD", "Serbian Dinar"), + ("CSD", "Serbian Dinar (2002–2006)"), + ("SCR", "Seychellois Rupee"), + ("SLL", "Sierra Leonean Leone (1964—2022)"), + ("XAG", "Silver"), + ("SGD", "Singapore Dollar"), + ("SKK", "Slovak Koruna"), + ("SIT", "Slovenian Tolar"), + ("SBD", "Solomon Islands Dollar"), + ("SOS", "Somali Shilling"), + ("ZAR", "South African Rand"), + ("ZAL", "South African Rand (financial)"), + ("KRH", "South Korean Hwan (1953–1962)"), + ("KRW", "South Korean Won"), + ("KRO", "South Korean Won (1945–1953)"), + ("SSP", "South Sudanese Pound"), + ("SUR", "Soviet Rouble"), + ("ESP", "Spanish Peseta"), + ("ESA", "Spanish Peseta (A account)"), + ("ESB", "Spanish Peseta (convertible account)"), + ("XDR", "Special Drawing Rights"), + ("LKR", "Sri Lankan Rupee"), + ("SHP", "St. Helena Pound"), + ("XSU", "Sucre"), + ("SDD", "Sudanese Dinar (1992–2007)"), + ("SDG", "Sudanese Pound"), + ("SDP", "Sudanese Pound (1957–1998)"), + ("SRD", "Surinamese Dollar"), + ("SRG", "Surinamese Guilder"), + ("SZL", "Swazi Lilangeni"), + ("SEK", "Swedish Krona"), + ("CHF", "Swiss Franc"), + ("SYP", "Syrian Pound"), + ("STN", "São Tomé & Príncipe Dobra"), + ("STD", "São Tomé & Príncipe Dobra (1977–2017)"), + ("TVD", "TVD"), + ("TJR", "Tajikistani Ruble"), + ("TJS", "Tajikistani Somoni"), + ("TZS", "Tanzanian Shilling"), + ("XTS", "Testing Currency Code"), + ("THB", "Thai Baht"), + ( + "XXX", + "The codes assigned for transactions where no currency is involved", + ), + ("TPE", "Timorese Escudo"), + ("TOP", "Tongan Paʻanga"), + ("TTD", "Trinidad & Tobago Dollar"), + ("TND", "Tunisian Dinar"), + ("TRY", "Turkish Lira"), + ("TRL", "Turkish Lira (1922–2005)"), + ("TMT", "Turkmenistani Manat"), + ("TMM", "Turkmenistani Manat (1993–2009)"), + ("USD", "US Dollar"), + ("USN", "US Dollar (Next day)"), + ("USS", "US Dollar (Same day)"), + ("UGX", "Ugandan Shilling"), + ("UGS", "Ugandan Shilling (1966–1987)"), + ("UAH", "Ukrainian Hryvnia"), + ("UAK", "Ukrainian Karbovanets"), + ("AED", "United Arab Emirates Dirham"), + ("UYW", "Uruguayan Nominal Wage Index Unit"), + ("UYU", "Uruguayan Peso"), + ("UYP", "Uruguayan Peso (1975–1993)"), + ("UYI", "Uruguayan Peso (Indexed Units)"), + ("UZS", "Uzbekistani Som"), + ("VUV", "Vanuatu Vatu"), + ("VES", "Venezuelan Bolívar"), + ("VEB", "Venezuelan Bolívar (1871–2008)"), + ("VEF", "Venezuelan Bolívar (2008–2018)"), + ("VND", "Vietnamese Dong"), + ("VNN", "Vietnamese Dong (1978–1985)"), + ("CHE", "WIR Euro"), + ("CHW", "WIR Franc"), + ("XOF", "West African CFA Franc"), + ("YDD", "Yemeni Dinar"), + ("YER", "Yemeni Rial"), + ("YUN", "Yugoslavian Convertible Dinar (1990–1992)"), + ("YUD", "Yugoslavian Hard Dinar (1966–1990)"), + ("YUM", "Yugoslavian New Dinar (1994–2002)"), + ("YUR", "Yugoslavian Reformed Dinar (1992–1993)"), + ("ZWN", "ZWN"), + ("ZRN", "Zairean New Zaire (1993–1998)"), + ("ZRZ", "Zairean Zaire (1971–1993)"), + ("ZMW", "Zambian Kwacha"), + ("ZMK", "Zambian Kwacha (1968–2012)"), + ("ZWD", "Zimbabwean Dollar (1980–2008)"), + ("ZWR", "Zimbabwean Dollar (2008)"), + ("ZWL", "Zimbabwean Dollar (2009)"), + ], + default="CHF", + editable=False, + max_length=3, + null=True, + ), + ), + migrations.AlterField( + model_name="pricinggeometry", + name="unit_price_currency", + field=djmoney.models.fields.CurrencyField( + choices=[ + ("XUA", "ADB Unit of Account"), + ("AFN", "Afghan Afghani"), + ("AFA", "Afghan Afghani (1927–2002)"), + ("ALL", "Albanian Lek"), + ("ALK", "Albanian Lek (1946–1965)"), + ("DZD", "Algerian Dinar"), + ("ADP", "Andorran Peseta"), + ("AOA", "Angolan Kwanza"), + ("AOK", "Angolan Kwanza (1977–1991)"), + ("AON", "Angolan New Kwanza (1990–2000)"), + ("AOR", "Angolan Readjusted Kwanza (1995–1999)"), + ("ARA", "Argentine Austral"), + ("ARS", "Argentine Peso"), + ("ARM", "Argentine Peso (1881–1970)"), + ("ARP", "Argentine Peso (1983–1985)"), + ("ARL", "Argentine Peso Ley (1970–1983)"), + ("AMD", "Armenian Dram"), + ("AWG", "Aruban Florin"), + ("AUD", "Australian Dollar"), + ("ATS", "Austrian Schilling"), + ("AZN", "Azerbaijani Manat"), + ("AZM", "Azerbaijani Manat (1993–2006)"), + ("BSD", "Bahamian Dollar"), + ("BHD", "Bahraini Dinar"), + ("BDT", "Bangladeshi Taka"), + ("BBD", "Barbadian Dollar"), + ("BYN", "Belarusian Ruble"), + ("BYB", "Belarusian Ruble (1994–1999)"), + ("BYR", "Belarusian Ruble (2000–2016)"), + ("BEF", "Belgian Franc"), + ("BEC", "Belgian Franc (convertible)"), + ("BEL", "Belgian Franc (financial)"), + ("BZD", "Belize Dollar"), + ("BMD", "Bermudan Dollar"), + ("BTN", "Bhutanese Ngultrum"), + ("BOB", "Bolivian Boliviano"), + ("BOL", "Bolivian Boliviano (1863–1963)"), + ("BOV", "Bolivian Mvdol"), + ("BOP", "Bolivian Peso"), + ("BAM", "Bosnia-Herzegovina Convertible Mark"), + ("BAD", "Bosnia-Herzegovina Dinar (1992–1994)"), + ("BAN", "Bosnia-Herzegovina New Dinar (1994–1997)"), + ("BWP", "Botswanan Pula"), + ("BRC", "Brazilian Cruzado (1986–1989)"), + ("BRZ", "Brazilian Cruzeiro (1942–1967)"), + ("BRE", "Brazilian Cruzeiro (1990–1993)"), + ("BRR", "Brazilian Cruzeiro (1993–1994)"), + ("BRN", "Brazilian New Cruzado (1989–1990)"), + ("BRB", "Brazilian New Cruzeiro (1967–1986)"), + ("BRL", "Brazilian Real"), + ("GBP", "British Pound"), + ("BND", "Brunei Dollar"), + ("BGL", "Bulgarian Hard Lev"), + ("BGN", "Bulgarian Lev"), + ("BGO", "Bulgarian Lev (1879–1952)"), + ("BGM", "Bulgarian Socialist Lev"), + ("BUK", "Burmese Kyat"), + ("BIF", "Burundian Franc"), + ("XPF", "CFP Franc"), + ("KHR", "Cambodian Riel"), + ("CAD", "Canadian Dollar"), + ("CVE", "Cape Verdean Escudo"), + ("KYD", "Cayman Islands Dollar"), + ("XAF", "Central African CFA Franc"), + ("CLE", "Chilean Escudo"), + ("CLP", "Chilean Peso"), + ("CLF", "Chilean Unit of Account (UF)"), + ("CNX", "Chinese People’s Bank Dollar"), + ("CNY", "Chinese Yuan"), + ("CNH", "Chinese Yuan (offshore)"), + ("COP", "Colombian Peso"), + ("COU", "Colombian Real Value Unit"), + ("KMF", "Comorian Franc"), + ("CDF", "Congolese Franc"), + ("CRC", "Costa Rican Colón"), + ("HRD", "Croatian Dinar"), + ("HRK", "Croatian Kuna"), + ("CUC", "Cuban Convertible Peso"), + ("CUP", "Cuban Peso"), + ("CYP", "Cypriot Pound"), + ("CZK", "Czech Koruna"), + ("CSK", "Czechoslovak Hard Koruna"), + ("DKK", "Danish Krone"), + ("DJF", "Djiboutian Franc"), + ("DOP", "Dominican Peso"), + ("NLG", "Dutch Guilder"), + ("XCD", "East Caribbean Dollar"), + ("DDM", "East German Mark"), + ("ECS", "Ecuadorian Sucre"), + ("ECV", "Ecuadorian Unit of Constant Value"), + ("EGP", "Egyptian Pound"), + ("GQE", "Equatorial Guinean Ekwele"), + ("ERN", "Eritrean Nakfa"), + ("EEK", "Estonian Kroon"), + ("ETB", "Ethiopian Birr"), + ("EUR", "Euro"), + ("XBA", "European Composite Unit"), + ("XEU", "European Currency Unit"), + ("XBB", "European Monetary Unit"), + ("XBC", "European Unit of Account (XBC)"), + ("XBD", "European Unit of Account (XBD)"), + ("FKP", "Falkland Islands Pound"), + ("FJD", "Fijian Dollar"), + ("FIM", "Finnish Markka"), + ("FRF", "French Franc"), + ("XFO", "French Gold Franc"), + ("XFU", "French UIC-Franc"), + ("GMD", "Gambian Dalasi"), + ("GEK", "Georgian Kupon Larit"), + ("GEL", "Georgian Lari"), + ("DEM", "German Mark"), + ("GHS", "Ghanaian Cedi"), + ("GHC", "Ghanaian Cedi (1979–2007)"), + ("GIP", "Gibraltar Pound"), + ("XAU", "Gold"), + ("GRD", "Greek Drachma"), + ("GTQ", "Guatemalan Quetzal"), + ("GWP", "Guinea-Bissau Peso"), + ("GNF", "Guinean Franc"), + ("GNS", "Guinean Syli"), + ("GYD", "Guyanaese Dollar"), + ("HTG", "Haitian Gourde"), + ("HNL", "Honduran Lempira"), + ("HKD", "Hong Kong Dollar"), + ("HUF", "Hungarian Forint"), + ("IMP", "IMP"), + ("ISK", "Icelandic Króna"), + ("ISJ", "Icelandic Króna (1918–1981)"), + ("INR", "Indian Rupee"), + ("IDR", "Indonesian Rupiah"), + ("IRR", "Iranian Rial"), + ("IQD", "Iraqi Dinar"), + ("IEP", "Irish Pound"), + ("ILS", "Israeli New Shekel"), + ("ILP", "Israeli Pound"), + ("ILR", "Israeli Shekel (1980–1985)"), + ("ITL", "Italian Lira"), + ("JMD", "Jamaican Dollar"), + ("JPY", "Japanese Yen"), + ("JOD", "Jordanian Dinar"), + ("KZT", "Kazakhstani Tenge"), + ("KES", "Kenyan Shilling"), + ("KWD", "Kuwaiti Dinar"), + ("KGS", "Kyrgystani Som"), + ("LAK", "Laotian Kip"), + ("LVL", "Latvian Lats"), + ("LVR", "Latvian Ruble"), + ("LBP", "Lebanese Pound"), + ("LSL", "Lesotho Loti"), + ("LRD", "Liberian Dollar"), + ("LYD", "Libyan Dinar"), + ("LTL", "Lithuanian Litas"), + ("LTT", "Lithuanian Talonas"), + ("LUL", "Luxembourg Financial Franc"), + ("LUC", "Luxembourgian Convertible Franc"), + ("LUF", "Luxembourgian Franc"), + ("MOP", "Macanese Pataca"), + ("MKD", "Macedonian Denar"), + ("MKN", "Macedonian Denar (1992–1993)"), + ("MGA", "Malagasy Ariary"), + ("MGF", "Malagasy Franc"), + ("MWK", "Malawian Kwacha"), + ("MYR", "Malaysian Ringgit"), + ("MVR", "Maldivian Rufiyaa"), + ("MVP", "Maldivian Rupee (1947–1981)"), + ("MLF", "Malian Franc"), + ("MTL", "Maltese Lira"), + ("MTP", "Maltese Pound"), + ("MRU", "Mauritanian Ouguiya"), + ("MRO", "Mauritanian Ouguiya (1973–2017)"), + ("MUR", "Mauritian Rupee"), + ("MXV", "Mexican Investment Unit"), + ("MXN", "Mexican Peso"), + ("MXP", "Mexican Silver Peso (1861–1992)"), + ("MDC", "Moldovan Cupon"), + ("MDL", "Moldovan Leu"), + ("MCF", "Monegasque Franc"), + ("MNT", "Mongolian Tugrik"), + ("MAD", "Moroccan Dirham"), + ("MAF", "Moroccan Franc"), + ("MZE", "Mozambican Escudo"), + ("MZN", "Mozambican Metical"), + ("MZM", "Mozambican Metical (1980–2006)"), + ("MMK", "Myanmar Kyat"), + ("NAD", "Namibian Dollar"), + ("NPR", "Nepalese Rupee"), + ("ANG", "Netherlands Antillean Guilder"), + ("TWD", "New Taiwan Dollar"), + ("NZD", "New Zealand Dollar"), + ("NIO", "Nicaraguan Córdoba"), + ("NIC", "Nicaraguan Córdoba (1988–1991)"), + ("NGN", "Nigerian Naira"), + ("KPW", "North Korean Won"), + ("NOK", "Norwegian Krone"), + ("OMR", "Omani Rial"), + ("PKR", "Pakistani Rupee"), + ("XPD", "Palladium"), + ("PAB", "Panamanian Balboa"), + ("PGK", "Papua New Guinean Kina"), + ("PYG", "Paraguayan Guarani"), + ("PEI", "Peruvian Inti"), + ("PEN", "Peruvian Sol"), + ("PES", "Peruvian Sol (1863–1965)"), + ("PHP", "Philippine Peso"), + ("XPT", "Platinum"), + ("PLN", "Polish Zloty"), + ("PLZ", "Polish Zloty (1950–1995)"), + ("PTE", "Portuguese Escudo"), + ("GWE", "Portuguese Guinea Escudo"), + ("QAR", "Qatari Riyal"), + ("XRE", "RINET Funds"), + ("RHD", "Rhodesian Dollar"), + ("RON", "Romanian Leu"), + ("ROL", "Romanian Leu (1952–2006)"), + ("RUB", "Russian Ruble"), + ("RUR", "Russian Ruble (1991–1998)"), + ("RWF", "Rwandan Franc"), + ("SVC", "Salvadoran Colón"), + ("WST", "Samoan Tala"), + ("SAR", "Saudi Riyal"), + ("RSD", "Serbian Dinar"), + ("CSD", "Serbian Dinar (2002–2006)"), + ("SCR", "Seychellois Rupee"), + ("SLL", "Sierra Leonean Leone (1964—2022)"), + ("XAG", "Silver"), + ("SGD", "Singapore Dollar"), + ("SKK", "Slovak Koruna"), + ("SIT", "Slovenian Tolar"), + ("SBD", "Solomon Islands Dollar"), + ("SOS", "Somali Shilling"), + ("ZAR", "South African Rand"), + ("ZAL", "South African Rand (financial)"), + ("KRH", "South Korean Hwan (1953–1962)"), + ("KRW", "South Korean Won"), + ("KRO", "South Korean Won (1945–1953)"), + ("SSP", "South Sudanese Pound"), + ("SUR", "Soviet Rouble"), + ("ESP", "Spanish Peseta"), + ("ESA", "Spanish Peseta (A account)"), + ("ESB", "Spanish Peseta (convertible account)"), + ("XDR", "Special Drawing Rights"), + ("LKR", "Sri Lankan Rupee"), + ("SHP", "St. Helena Pound"), + ("XSU", "Sucre"), + ("SDD", "Sudanese Dinar (1992–2007)"), + ("SDG", "Sudanese Pound"), + ("SDP", "Sudanese Pound (1957–1998)"), + ("SRD", "Surinamese Dollar"), + ("SRG", "Surinamese Guilder"), + ("SZL", "Swazi Lilangeni"), + ("SEK", "Swedish Krona"), + ("CHF", "Swiss Franc"), + ("SYP", "Syrian Pound"), + ("STN", "São Tomé & Príncipe Dobra"), + ("STD", "São Tomé & Príncipe Dobra (1977–2017)"), + ("TVD", "TVD"), + ("TJR", "Tajikistani Ruble"), + ("TJS", "Tajikistani Somoni"), + ("TZS", "Tanzanian Shilling"), + ("XTS", "Testing Currency Code"), + ("THB", "Thai Baht"), + ( + "XXX", + "The codes assigned for transactions where no currency is involved", + ), + ("TPE", "Timorese Escudo"), + ("TOP", "Tongan Paʻanga"), + ("TTD", "Trinidad & Tobago Dollar"), + ("TND", "Tunisian Dinar"), + ("TRY", "Turkish Lira"), + ("TRL", "Turkish Lira (1922–2005)"), + ("TMT", "Turkmenistani Manat"), + ("TMM", "Turkmenistani Manat (1993–2009)"), + ("USD", "US Dollar"), + ("USN", "US Dollar (Next day)"), + ("USS", "US Dollar (Same day)"), + ("UGX", "Ugandan Shilling"), + ("UGS", "Ugandan Shilling (1966–1987)"), + ("UAH", "Ukrainian Hryvnia"), + ("UAK", "Ukrainian Karbovanets"), + ("AED", "United Arab Emirates Dirham"), + ("UYW", "Uruguayan Nominal Wage Index Unit"), + ("UYU", "Uruguayan Peso"), + ("UYP", "Uruguayan Peso (1975–1993)"), + ("UYI", "Uruguayan Peso (Indexed Units)"), + ("UZS", "Uzbekistani Som"), + ("VUV", "Vanuatu Vatu"), + ("VES", "Venezuelan Bolívar"), + ("VEB", "Venezuelan Bolívar (1871–2008)"), + ("VEF", "Venezuelan Bolívar (2008–2018)"), + ("VND", "Vietnamese Dong"), + ("VNN", "Vietnamese Dong (1978–1985)"), + ("CHE", "WIR Euro"), + ("CHW", "WIR Franc"), + ("XOF", "West African CFA Franc"), + ("YDD", "Yemeni Dinar"), + ("YER", "Yemeni Rial"), + ("YUN", "Yugoslavian Convertible Dinar (1990–1992)"), + ("YUD", "Yugoslavian Hard Dinar (1966–1990)"), + ("YUM", "Yugoslavian New Dinar (1994–2002)"), + ("YUR", "Yugoslavian Reformed Dinar (1992–1993)"), + ("ZWN", "ZWN"), + ("ZRN", "Zairean New Zaire (1993–1998)"), + ("ZRZ", "Zairean Zaire (1971–1993)"), + ("ZMW", "Zambian Kwacha"), + ("ZMK", "Zambian Kwacha (1968–2012)"), + ("ZWD", "Zimbabwean Dollar (1980–2008)"), + ("ZWR", "Zimbabwean Dollar (2008)"), + ("ZWL", "Zimbabwean Dollar (2009)"), + ], + default="CHF", + editable=False, + max_length=3, + null=True, + ), + ), + ] diff --git a/back/api/migrations/__init__.py b/api/migrations/__init__.py similarity index 100% rename from back/api/migrations/__init__.py rename to api/migrations/__init__.py diff --git a/api/models.py b/api/models.py new file mode 100644 index 00000000..2dac43d5 --- /dev/null +++ b/api/models.py @@ -0,0 +1,1064 @@ +import logging +import secrets +import uuid +from django.conf import settings +from django.core.validators import RegexValidator +from django.contrib.gis.db import models +from django.contrib.gis.geos import MultiPolygon, Polygon +from django.contrib.auth import get_user_model +from django.contrib.postgres.search import SearchVectorField +from django.contrib.postgres.indexes import GinIndex, BTreeIndex +from django.utils import timezone +from django.utils.html import mark_safe +from django.utils.translation import gettext_lazy as _ +from django.urls import reverse +from djmoney.money import Money +from djmoney.models.fields import MoneyField + +from .pricing import ProductPriceCalculator +from .helpers import RandomFileName, send_geoshop_email + +LOGGER = logging.getLogger(__name__) +# Get the UserModel +UserModel = get_user_model() + + +class AbstractIdentity(models.Model): + """ + Common properties for identities, addresses and temporary users + """ + + first_name = models.CharField(_("first_name"), max_length=50, blank=True) + last_name = models.CharField(_("last_name"), max_length=150, blank=True) + email = models.EmailField(_("email"), max_length=254, blank=True) + street = models.CharField(_("street"), max_length=100, blank=True) + street2 = models.CharField(_("street2"), max_length=100, blank=True) + postcode = models.CharField(_("postcode"), max_length=10, blank=True) + city = models.CharField(_("city"), max_length=50, blank=True) + country = models.CharField(_("country"), max_length=50, blank=True) + company_name = models.CharField(_("company_name"), max_length=250, blank=True) + phone = models.CharField(_("phone"), max_length=50, blank=True) + + class Meta: + abstract = True + + def __str__(self): + if self.company_name: + return "%s %s (%s)" % (self.last_name, self.first_name, self.company_name) + return "%s %s" % (self.last_name, self.first_name) + + +class Contact(AbstractIdentity): + """ + Address book of contacts linked to an user that stores addresses + previously filled by the user. + """ + + belongs_to = models.ForeignKey( + UserModel, on_delete=models.CASCADE, verbose_name=_("belongs_to") + ) + sap_id = models.BigIntegerField(_("sap_id"), null=True, blank=True) + subscribed = models.BooleanField(_("subscribed"), default=False) + is_active = models.BooleanField(_("is_active"), default=True) + + class Meta: + db_table = "contact" + verbose_name = _("contact") + + +class Copyright(models.Model): + description = models.TextField(blank=True) + + class Meta: + db_table = "copyright" + verbose_name = _("copyright") + + def __str__(self): + return self.description + + +class Document(models.Model): + """ + Named links to more informations on metadata + """ + + name = models.CharField(_("name"), max_length=80) + link = models.URLField( + _("link"), help_text=_("Please complete the above URL"), max_length=2000 + ) + + class Meta: + db_table = "document" + verbose_name = _("document") + + def __str__(self): + return "%s (%s)" % (self.name, self.link.split("/")[-1]) + + +class DataFormat(models.Model): + name = models.CharField(_("name"), max_length=100, blank=True) + + class Meta: + db_table = "data_format" + verbose_name = _("data_format") + + def __str__(self): + return self.name + + +class OrderType(models.Model): + name = models.CharField(_("name"), max_length=30, blank=True) + + class Meta: + db_table = "order_type" + verbose_name = _("order type") + verbose_name_plural = _("order types") + + def __str__(self): + return self.name + + +class Identity(AbstractIdentity): + """ + All users have an Identity but not all identities are users. + """ + + user = models.OneToOneField( + UserModel, + on_delete=models.SET_NULL, + verbose_name=_("user"), + blank=True, + null=True, + ) + sap_id = models.BigIntegerField(_("sap_id"), null=True, blank=True) + ide_id = models.CharField( + _("ide_number"), + max_length=15, + null=True, + blank=True, + validators=[ + RegexValidator( + regex=r"^CHE-([0-9]{3}\.){2}[0-9]{3}$", + message=_("IDE number is not valid"), + ), + ], + ) + contract_accepted = models.DateField(_("contract_accepted"), null=True, blank=True) + is_public = models.BooleanField(_("is_public"), default=False) + subscribed = models.BooleanField(_("subscribed"), default=False) + birthday = models.DateField(_("birthday"), null=True, blank=True) + + class Meta: + db_table = "identity" + verbose_name = _("identity") + + +class MetadataCategoryEch(models.Model): + """ + Imported list of eCH categories used to thematize metadatas + """ + + notation = models.CharField(_("notation"), max_length=3, unique=True) + description_fr = models.CharField(_("description_fr"), max_length=250) + + class Meta: + db_table = "metadata_category_ech" + verbose_name = _("metadata_category_ech") + + def __str__(self): + return "%s (%s)" % (self.description_fr, self.notation) + + +class Metadata(models.Model): + """ + Describes one or more Products. Every metadata can have one or more contact persons + """ + + class MetadataAccessibility(models.TextChoices): + PUBLIC = "PUBLIC", _("Public") + APPROVAL_NEEDED = "APPROVAL_NEEDED", _("Approval needed") + NOT_ACCESSIBLE = "NOT_ACCESSIBLE", _("Not accessible") + INTERNAL = "INTERNAL", _("Internal") + + id_name = models.CharField(_("id_name"), max_length=100, unique=True) + name = models.CharField(_("name"), max_length=300, blank=True) + ech_category = models.ForeignKey( + MetadataCategoryEch, + models.SET_NULL, + verbose_name=_("ech_category"), + null=True, + blank=True, + ) + description_long = models.TextField(_("description_long"), blank=True) + genealogy = models.TextField(_("genealogy"), blank=True) + datasource = models.CharField( + _("datasource"), max_length=260, blank=True, null=True + ) + accessibility = models.CharField( + _("accessibility"), + max_length=30, + choices=MetadataAccessibility.choices, + default=MetadataAccessibility.PUBLIC, + ) + scale = models.CharField(_("scale"), max_length=50, blank=True) + geocat_link = models.CharField(_("geocat_link"), max_length=2000, blank=True) + legend_link = models.CharField(_("legend_link"), max_length=2000, blank=True) + image_link = models.CharField( + _("image_link"), + max_length=250, + default=settings.DEFAULT_METADATA_IMAGE_URL, + blank=True, + ) + wms_link = models.CharField(_("wms_link"), max_length=2000, blank=True) + geoportal_link = models.CharField(_("geoportal_link"), max_length=2000, blank=True) + copyright = models.ForeignKey( + Copyright, models.SET_NULL, verbose_name=_("copyright"), blank=True, null=True + ) + documents = models.ManyToManyField( + Document, verbose_name=_("documents"), blank=True + ) + contact_persons = models.ManyToManyField( + Identity, + verbose_name=_("contact_persons"), + related_name="contact_persons", + through="MetadataContact", + ) + modified_date = models.DateTimeField(auto_now=True) + modified_user = models.ForeignKey( + UserModel, + models.PROTECT, + verbose_name=_("modified_user"), + related_name="modified_user", + ) + data_last_update_date = models.DateField( + _("data_last_update_date"), null=True, blank=True + ) + update_frequency = models.CharField( + _("update_frequency"), max_length=50, blank=True + ) + + class Meta: + db_table = "metadata" + verbose_name = _("metadata") + permissions = [ + ( + "view_internal", + _('Can view metadata with accessibility set to "internal"'), + ) + ] + + def __str__(self): + return self.id_name + + def get_legend_link(self): + if self.legend_link is None or self.legend_link == "": + return None + # When legend_link is 0, returns legend from mapserver + if self.legend_link == "0": + return settings.AUTO_LEGEND_URL + self.id_name + # When legend_link is intra, returns legend from intranet mapserver + if self.legend_link == "intra": + return settings.INTRA_LEGEND_URL + self.id_name + if self.legend_link.startswith("http"): + return self.legend_link + return settings.MEDIA_URL + self.legend_link + + def legend_tag(self): + if self.get_legend_link(): + return mark_safe('' % self.get_legend_link()) + + legend_tag.short_description = _("legend") + + def image_tag(self): + if self.image_link is None or self.image_link == "": + return mark_safe( + '' % (settings.MEDIA_URL, "no_image.jpg") + ) + return mark_safe('' % (settings.MEDIA_URL, self.image_link)) + + image_tag.short_description = _("image") + + +class MetadataContact(models.Model): + """ + Links Metadata with the persons to contact (Identity) depending on the role they play for metadata. + """ + + metadata = models.ForeignKey(Metadata, models.CASCADE, verbose_name=_("metadata")) + contact_person = models.ForeignKey( + Identity, + models.CASCADE, + verbose_name=_("contact_person"), + limit_choices_to={"is_public": True}, + ) + metadata_role = models.CharField(_("role"), max_length=150, default=_("Manager")) + is_validator = models.BooleanField(_("is_validator"), default=False) + + class Meta: + db_table = "metadata_contact_persons" + verbose_name = _("metadata_contact") + + def __str__(self): + return "%s - %s (%s)" % (self.contact_person, self.metadata, self.metadata_role) + + +class Pricing(models.Model): + """ + Pricing for free products, single tax products or area priced products. + For free products, set base_fee and unit_price both to 0. + For unique price set base_fee to desired amount and unit_price to 0. + For price based on area, provide unit_price + For prices based on a PricingGeometry, create the pricing layer and + link it to pricing_layer field. + """ + + class PricingType(models.TextChoices): + FREE = "FREE", _("Free") + SINGLE = "SINGLE", _("Single") + BY_NUMBER_OBJECTS = "BY_NUMBER_OBJECTS", _("By number of objects") + BY_AREA = "BY_AREA", _("By area") + FROM_PRICING_LAYER = "FROM_PRICING_LAYER", _("From a pricing layer") + FROM_CHILDREN_OF_GROUP = "FROM_CHILDREN_OF_GROUP", _( + "From children products of this group" + ) + MANUAL = "MANUAL", _("Manual") + + name = models.CharField(_("name"), max_length=100, null=True, blank=True) + pricing_type = models.CharField( + _("pricing_type"), max_length=30, choices=PricingType.choices + ) + base_fee = MoneyField( + _("base_fee"), + max_digits=14, + decimal_places=2, + default_currency=settings.DEFAULT_CURRENCY, + null=True, + blank=True, + ) + min_price = MoneyField( + _("min_price"), + max_digits=14, + decimal_places=2, + default_currency=settings.DEFAULT_CURRENCY, + null=True, + blank=True, + ) + max_price = MoneyField( + _("max_price"), + max_digits=14, + decimal_places=2, + default_currency=settings.DEFAULT_CURRENCY, + null=True, + blank=True, + ) + unit_price = MoneyField( + _("unit_price"), + max_digits=14, + decimal_places=2, + default_currency=settings.DEFAULT_CURRENCY, + null=True, + blank=True, + ) + + class Meta: + db_table = "pricing" + verbose_name = _("pricing") + + def get_price(self, polygon): + """ + Returns the price of a product given a polygon + """ + price = ProductPriceCalculator.get_price(pricing_instance=self, polygon=polygon) + + if price is None: + return None, None + + if self.min_price and price < self.min_price: + return self.min_price, self.base_fee + + # if max_price is reached, will force customer ask for a quote + if self.max_price and price > self.max_price: + return None, None + + return price, self.base_fee + + def __str__(self): + return "%s + %s CHF de taxe" % (self.name, self.base_fee) + + +class PricingGeometry(models.Model): + """ + Areas defining prices must be grouped by name. + """ + + name = models.CharField(_("name"), max_length=300, null=True) + unit_price = MoneyField( + _("price"), + max_digits=14, + decimal_places=2, + default_currency=settings.DEFAULT_CURRENCY, + null=True, + ) + geom = models.GeometryField(_("geom"), srid=settings.DEFAULT_SRID) + pricing = models.ForeignKey( + Pricing, models.CASCADE, verbose_name=_("pricing"), null=True + ) + + class Meta: + db_table = "pricing_layer" + verbose_name = _("pricing_layer") + indexes = (BTreeIndex(fields=("name",)),) + + def __str__(self): + return self.name + + +class Product(models.Model): + """ + A product is mostly a table or a raster. It can also be a group of products. + + Products with a PUBLISHED status are available in catalogue. + A product with a status PUBLISHED_ONLY_IN_GROUP cannot be found on + catalogue but can be ordered by the group he belongs to. + + Example: + PFP3_categorie_1 and PFP3_categorie_2 have a PUBLISHED_ONLY_IN_GROUP status: + they cannot be found as is in the catalogue, but they belong to another + product (with group_id property): PFP3 that has a PUBLISHED status. + """ + + class ProductStatus(models.TextChoices): + DRAFT = "DRAFT", _("Draft") + PUBLISHED = "PUBLISHED", _("Published") + PUBLISHED_ONLY_IN_GROUP = "PUBLISHED_ONLY_IN_GROUP", _( + "Published only in group" + ) + DEPRECATED = "DEPRECATED", _("Deprecated") + + metadata = models.ForeignKey( + Metadata, + models.PROTECT, + verbose_name=_("metadata"), + limit_choices_to=models.Q(accessibility=Metadata.MetadataAccessibility.PUBLIC) + | models.Q(accessibility=Metadata.MetadataAccessibility.APPROVAL_NEEDED), + ) + label = models.CharField( + _("label"), + max_length=250, + unique=True, + validators=[ + RegexValidator( + regex=r'^[^<>%$"\(\)\n\r]*$', + message=_("Label contains forbidden characters"), + ), + ], + ) + status = models.CharField( + _("status"), + max_length=30, + choices=ProductStatus.choices, + default=ProductStatus.DRAFT, + ) + group = models.ForeignKey( + "self", + models.SET_NULL, + verbose_name=_("group"), + blank=True, + null=True, + related_name="products", + ) + provider = models.ForeignKey( + UserModel, + models.PROTECT, + verbose_name=_("provider"), + limit_choices_to={"groups__name": "extract"}, + ) + pricing = models.ForeignKey(Pricing, models.PROTECT, verbose_name=_("pricing")) + free_when_subscribed = models.BooleanField(_("free_when_subscribed"), default=False) + order = models.BigIntegerField(_("order_index"), blank=True, null=True) + thumbnail_link = models.CharField( + _("thumbnail_link"), + max_length=250, + default=settings.DEFAULT_PRODUCT_THUMBNAIL_URL, + ) + ts = SearchVectorField(null=True) + #TODO: A geom defaulting to None would be great, meaning product is available everywhere + geom = models.MultiPolygonField( + _("geom"), + srid=settings.DEFAULT_SRID, + default=MultiPolygon(Polygon.from_bbox((2519900, 1186430, 2578200, 1227030))), + ) + + class Meta: + db_table = "product" + verbose_name = _("product") + ordering = ["order"] + # https://www.postgresql.org/docs/10/gin-intro.html + indexes = [GinIndex(fields=["ts"])] + + def __str__(self): + return self.label + + def thumbnail_tag(self): + if self.thumbnail_link is None or self.thumbnail_link == "": + return mark_safe( + '' % (settings.MEDIA_URL, "no_image.jpg") + ) + return mark_safe( + '' % (settings.MEDIA_URL, self.thumbnail_link) + ) + + thumbnail_tag.short_description = _("thumbnail") + + +class Order(models.Model): + """ + processing_fee should default to the maximum of base fees in the order but can then be edited mannually + """ + + class OrderStatus(models.TextChoices): + DRAFT = "DRAFT", _("Draft") + PENDING = "PENDING", _("Pending") + QUOTE_DONE = "QUOTE_DONE", _("Quote done") + READY = "READY", _("Ready") + IN_EXTRACT = "IN_EXTRACT", _("In extract") + PARTIALLY_DELIVERED = "PARTIALLY_DELIVERED", _("Partially delivered") + PROCESSED = "PROCESSED", _("Processed") + ARCHIVED = "ARCHIVED", _("Archived") + REJECTED = "REJECTED", _("Rejected") + + title = models.CharField( + _("title"), + max_length=255, + validators=[ + RegexValidator( + regex=r'^[^<>%$"\(\)\n\r]*$', + message=_("Title contains forbidden characters"), + ), + ], + ) + description = models.TextField(_("description"), blank=True) + processing_fee = MoneyField( + _("processing_fee"), + max_digits=14, + decimal_places=2, + default_currency=settings.DEFAULT_CURRENCY, + blank=True, + null=True, + ) + total_without_vat = MoneyField( + _("total_without_vat"), + max_digits=14, + decimal_places=2, + default_currency=settings.DEFAULT_CURRENCY, + blank=True, + null=True, + ) + part_vat = MoneyField( + _("part_vat"), + max_digits=14, + decimal_places=2, + default_currency=settings.DEFAULT_CURRENCY, + blank=True, + null=True, + ) + total_with_vat = MoneyField( + _("total_with_vat"), + max_digits=14, + decimal_places=2, + default_currency=settings.DEFAULT_CURRENCY, + blank=True, + null=True, + ) + geom = models.PolygonField(_("geom"), srid=settings.DEFAULT_SRID) + client = models.ForeignKey( + UserModel, models.PROTECT, verbose_name=_("client"), blank=True + ) + invoice_contact = models.ForeignKey( + Contact, + models.PROTECT, + verbose_name=_("invoice_contact"), + related_name="invoice_contact", + blank=True, + null=True, + ) + invoice_reference = models.CharField( + _("invoice_reference"), max_length=255, blank=True + ) + email_deliver = models.EmailField( + _("email_deliver"), max_length=254, blank=True, null=True + ) + order_type = models.ForeignKey( + OrderType, models.PROTECT, verbose_name=_("order_type") + ) + status = models.CharField( + _("status"), + max_length=20, + choices=OrderStatus.choices, + default=OrderStatus.DRAFT, + ) + date_ordered = models.DateTimeField(_("date_ordered"), blank=True, null=True) + date_downloaded = models.DateTimeField(_("date_downloaded"), blank=True, null=True) + date_processed = models.DateTimeField(_("date_processed"), blank=True, null=True) + extract_result = models.FileField(upload_to="extract", null=True, blank=True) + download_guid = models.UUIDField(_("download_guid"), null=True, blank=True) + + class Meta: + db_table = "order" + ordering = ["-date_ordered"] + verbose_name = _("order") + + def _reset_prices(self): + self.processing_fee = None + self.total_without_vat = None + self.part_vat = None + self.total_with_vat = None + + def ask_price(self): + send_geoshop_email( + _("Geoshop - Quote requested"), + template_name="email_admin", + template_data={ + "messages": [_("A new quote has been requested:")], + "details": { + _("order"): self.id, + _("link"): reverse("admin:api_order_change", args=[self.id]), + }, + }, + ) + + def set_price(self): + """ + Sets price information if all items have prices + """ + self._reset_prices() + items = self.items.all() + if items == []: + return False + self.total_without_vat = Money(0, settings.DEFAULT_CURRENCY) + self.processing_fee = Money(0, settings.DEFAULT_CURRENCY) + for item in items: + if item.base_fee is None: + self._reset_prices() + return False + if item.base_fee > self.processing_fee: + self.processing_fee = item.base_fee + self.total_without_vat += item.price + self.total_without_vat += self.processing_fee + self.part_vat = self.total_without_vat * settings.VAT + self.total_with_vat = self.total_without_vat + self.part_vat + return True + + def quote_done(self): + """Admins confirmation they have given a manual price""" + price_is_set = self.set_price() + if price_is_set: + self.status = self.OrderStatus.QUOTE_DONE + self.save() + send_geoshop_email( + _("Geoshop - Quote has been done"), + recipient=self.email_deliver or self.client.identity, + template_name="email_quote_done", + template_data={ + "order_id": self.id, + "first_name": self.client.identity.first_name, + "last_name": self.client.identity.last_name, + }, + ) + return price_is_set + + def _flatten_groups(self, group_of_products: Product, data_format: DataFormat): + """ + Creates an OrderItem for each child found in an incoming group_of_products. + The new OrderItems will inherit chosen data_format for the group if possible. + """ + for child_product in group_of_products.products.all(): + # if child_product is a group, recurse + if child_product.products.exists(): + self._flatten_groups(child_product, data_format) + continue + + # only create OrderItem for products that intersect current order geom + if child_product.geom.intersects(self.geom): + new_item = OrderItem( + order=self, product=child_product, data_format=data_format + ) + # If the data format for the group is not available for the item, + # pick the first possible + LOGGER.debug(f"{child_product.label} wants format: {data_format}") + if new_item.data_format.name not in new_item.available_formats: + LOGGER.warning( + f"{new_item.data_format} is not in {new_item.available_formats}" + ) + new_item.data_format = ( + child_product.product_formats.all().first().data_format + ) + new_item.set_price() + new_item.save() + + def _expand_product_groups(self): + """ + When an OrderItem is a group of products, the OrderItem is deleted from cart and + is replaced with one OrderItem for each product inside the group by calling + _flatten_groups. + """ + items = self.items.all() + for item in items: + # if ordered product is a group (if product has children) + if item.product.products.exists(): + self._flatten_groups(item.product, item.data_format) + item.delete() + + def confirm(self): + """Customer's confirmations he wants to proceed with the order""" + self._expand_product_groups() + items = self.items.all() + self.date_ordered = timezone.now() + self.download_guid = uuid.uuid4() + has_all_prices_calculated = True + for item in items: + if item.price_status == OrderItem.PricingStatus.PENDING: + has_all_prices_calculated = has_all_prices_calculated and False + if ( + item.product.metadata.accessibility + == Metadata.MetadataAccessibility.APPROVAL_NEEDED + ): + item.ask_validation() + item.save() + if has_all_prices_calculated: + self.status = Order.OrderStatus.READY + else: + self.ask_price() + self.status = Order.OrderStatus.PENDING + + def next_status_on_extract_input(self): + """Controls status when Extract uploads a file or cancel an order item""" + previous_accepted_status = [ + Order.OrderStatus.READY, + Order.OrderStatus.IN_EXTRACT, + Order.OrderStatus.PARTIALLY_DELIVERED, + ] + if self.status not in previous_accepted_status: + raise Exception("Order has an inappropriate status after input") + items_statuses = set(self.items.all().values_list("status", flat=True)) + + if ( + OrderItem.OrderItemStatus.IN_EXTRACT in items_statuses + or OrderItem.OrderItemStatus.PENDING in items_statuses + ): + if OrderItem.OrderItemStatus.PROCESSED in items_statuses: + self.status = Order.OrderStatus.PARTIALLY_DELIVERED + else: + self.status = Order.OrderStatus.READY + else: + if OrderItem.OrderItemStatus.PROCESSED in items_statuses: + if OrderItem.OrderItemStatus.VALIDATION_PENDING in items_statuses: + self.status = Order.OrderStatus.PARTIALLY_DELIVERED + else: + self.status = Order.OrderStatus.PROCESSED + self.date_processed = timezone.now() + send_geoshop_email( + _("Geoshop - Download ready"), + recipient=self.email_deliver or self.client.identity, + template_name="email_download_ready", + template_data={ + "order_id": self.id, + "download_guid": self.download_guid, + "front_url": "{}://{}{}".format( + settings.FRONT_PROTOCOL, + settings.FRONT_URL, + settings.FRONT_HREF, + ), + "first_name": self.client.identity.first_name, + "last_name": self.client.identity.last_name, + }, + ) + else: + self.status = Order.OrderStatus.REJECTED + return self.status + + @property + def geom_srid(self): + return self.geom.srid + + @property + def geom_area(self): + return self.geom.area + + def __str__(self): + return "%s - %s" % (self.id, self.title) + + +class OrderItem(models.Model): + """ + Cart item. + """ + + class PricingStatus(models.TextChoices): + PENDING = "PENDING", _("Pending") + CALCULATED = "CALCULATED", _("Calculated") + IMPORTED = "IMPORTED", _("Imported") # from old database + + class OrderItemStatus(models.TextChoices): + VALIDATION_PENDING = "VALIDATION_PENDING", _("Validation pending") + PENDING = "PENDING", _("Pending") + IN_EXTRACT = "IN_EXTRACT", _("In extract") + PROCESSED = "PROCESSED", _("Processed") + ARCHIVED = "ARCHIVED", _("Archived") + REJECTED = "REJECTED", _("Rejected") + + order = models.ForeignKey( + Order, + models.CASCADE, + related_name="items", + verbose_name=_("order"), + blank=True, + null=True, + ) + product = models.ForeignKey( + Product, models.PROTECT, verbose_name=_("product"), blank=True, null=True + ) + data_format = models.ForeignKey( + DataFormat, models.PROTECT, verbose_name=_("data_format"), blank=True, null=True + ) + srid = models.IntegerField(_("srid"), default=settings.DEFAULT_SRID) + last_download = models.DateTimeField(_("last_download"), blank=True, null=True) + validation_date = models.DateTimeField(_("validation_date"), blank=True, null=True) + price_status = models.CharField( + _("price_status"), + max_length=20, + choices=PricingStatus.choices, + default=PricingStatus.PENDING, + ) + status = models.CharField( + _("status"), + max_length=20, + choices=OrderItemStatus.choices, + default=OrderItemStatus.PENDING, + ) + _price = MoneyField( + _("price"), + max_digits=14, + decimal_places=2, + default_currency=settings.DEFAULT_CURRENCY, + null=True, + blank=True, + ) + _base_fee = MoneyField( + _("base_fee"), + max_digits=14, + decimal_places=2, + default_currency=settings.DEFAULT_CURRENCY, + null=True, + blank=True, + ) + extract_result = models.FileField( + upload_to=RandomFileName("extract"), null=True, blank=True + ) + comment = models.TextField(_("comment"), null=True, blank=True) + token = models.CharField(_("token"), max_length=256, null=True, blank=True) + + class Meta: + db_table = "order_item" + verbose_name = _("order_item") + + @property + def available_formats(self): + queryset = ProductFormat.objects.filter(product=self.product).values_list( + "data_format__name", flat=True + ) + return list(queryset) + + def _get_price_values(self, price_value): + if self.price_status == OrderItem.PricingStatus.PENDING: + LOGGER.info( + "You are trying to get a pricing value but pricing status is still PENDING" + ) + return None + return price_value + + @property + def price(self): + return self._get_price_values(self._price) + + @property + def base_fee(self): + return self._get_price_values(self._base_fee) + + def _calculate_nested_price(self, group_of_products: Product): + """ + Sums all levels of nested prices inside a group of products + to _self_price and sets _base_fee for the group + """ + for product in group_of_products.products.all(): + if product.products.exists(): + self._calculate_nested_price(product) + continue + if product.geom.intersects(self.order.geom): + price, base_fee = product.pricing.get_price(self.order.geom) + if price: + self._price += price + if base_fee and base_fee > self._base_fee: + self._base_fee = base_fee + + def set_price(self, price=None, base_fee=None): + """ + Sets price and updates price status + """ + self._price = None + self._base_fee = None + self.price_status = OrderItem.PricingStatus.PENDING + + # prices are 0 when user or invoice_contact is subscribed to the product + if self.order.order_type.name == "Utilisateur permanent": + if self.product.free_when_subscribed: + if self.order.client.identity.subscribed or ( + self.order.invoice_contact is not None + and self.order.invoice_contact.subscribed + ): + self._price = Money(0, settings.DEFAULT_CURRENCY) + self._base_fee = Money(0, settings.DEFAULT_CURRENCY) + self.price_status = OrderItem.PricingStatus.CALCULATED + return + # if user or contact is not subscribed, quote needs to be done + self.price_status = OrderItem.PricingStatus.PENDING + return + + # prices are 0 when order is for public authorities or academic purposes + if self.order.order_type.name in ( + "Communal", + "Cantonal", + "Fédéral", + "Académique", + ): + self._price = Money(0, settings.DEFAULT_CURRENCY) + self._base_fee = Money(0, settings.DEFAULT_CURRENCY) + self.price_status = OrderItem.PricingStatus.CALCULATED + return + + if self.product.pricing.pricing_type != Pricing.PricingType.MANUAL: + if ( + self.product.pricing.pricing_type + == Pricing.PricingType.FROM_CHILDREN_OF_GROUP + ): + # Pricing from children is only used when groups are present in cart + # When order is confirmed groups are falttenend and + # each price will be set individually + self._price = Money(0, settings.DEFAULT_CURRENCY) + self._base_fee = Money(0, settings.DEFAULT_CURRENCY) + self._calculate_nested_price(self.product) + else: + self._price, self._base_fee = self.product.pricing.get_price( + self.order.geom + ) + if self._price is not None: + self.price_status = OrderItem.PricingStatus.CALCULATED + return + # When price is MANUAL and a price is passed as argument of this function + else: + if price is not None: + self._price = price + self._base_fee = base_fee + self.price_status = OrderItem.PricingStatus.CALCULATED + return + self.price_status = OrderItem.PricingStatus.PENDING + return + + def ask_validation(self): + """ + Sends email to the first metadata contact that is validator to ask for validation. + If validator cannot be found, an email to one of the metadata contact is sent. + """ + self.token = secrets.token_urlsafe(32) + self.status = OrderItem.OrderItemStatus.VALIDATION_PENDING + validator = ( + MetadataContact.objects.filter(metadata=self.product.metadata) + .order_by("-is_validator") + .first() + ) + send_geoshop_email( + _("Geoshop - Validation requested"), + recipient=validator.contact_person, + template_name="email_validation_needed", + template_data={ + "front_url": "{}://{}{}".format( + settings.FRONT_PROTOCOL, settings.FRONT_URL, settings.FRONT_HREF + ), + "what": "orderitem", + "token": self.token, + }, + ) + + +class ProductField(models.Model): + """ + Describes fields and their types of products. + """ + + class ProductFieldType(models.TextChoices): + REAL = "REAL", "Real" + DATE = "DATE", "Date" + CHAR = "CHAR", "Character" + VARCHAR = "VARCHAR", "Varying character" + INT = "INT", "Integer" + BIGINT = "BIGINT", "Big integer" + FLOAT = "FLOAT", "Floating number" + + db_name = models.CharField(_("db_name"), max_length=50, blank=True) + export_name = models.CharField(_("export_name"), max_length=50, blank=True) + field_type = models.CharField( + _("field_type"), max_length=10, choices=ProductFieldType.choices, blank=True + ) + field_length = models.SmallIntegerField( + _("field_length"), + ) + product = models.ForeignKey( + Product, verbose_name=_("product"), on_delete=models.CASCADE + ) + + class Meta: + db_table = "product_field" + verbose_name = _("product_field") + + +class ProductFormat(models.Model): + product = models.ForeignKey( + Product, + models.CASCADE, + verbose_name=_("product"), + related_name="product_formats", + ) + data_format = models.ForeignKey( + DataFormat, models.CASCADE, verbose_name=_("data_format") + ) + # extraction manuelle ou automatique + is_manual = models.BooleanField(_("is_manual"), default=False) + + class Meta: + db_table = "product_format" + unique_together = (("product", "data_format"),) + verbose_name = _("product_format") + + +class UserChange(AbstractIdentity): + """ + Stores temporary data in order to proceed user profile change requests. + """ + + client = models.ForeignKey(UserModel, models.CASCADE, verbose_name=_("client")) + ide_id = models.CharField( + _("ide_number"), + max_length=15, + null=True, + blank=True, + validators=[ + RegexValidator( + regex=r"^CHE-([0-9]{3}\.){2}[0-9]{3}$", + message=_("IDE number is not valid"), + ), + ], + ) + + class Meta: + db_table = "user_change" + verbose_name = _("user_change") diff --git a/back/api/permissions.py b/api/permissions.py similarity index 100% rename from back/api/permissions.py rename to api/permissions.py diff --git a/back/api/pricing.py b/api/pricing.py similarity index 100% rename from back/api/pricing.py rename to api/pricing.py diff --git a/back/api/routers.py b/api/routers.py similarity index 100% rename from back/api/routers.py rename to api/routers.py diff --git a/back/api/serializers.py b/api/serializers.py similarity index 100% rename from back/api/serializers.py rename to api/serializers.py diff --git a/back/api/signals.py b/api/signals.py similarity index 100% rename from back/api/signals.py rename to api/signals.py diff --git a/back/api/static/api/admin-extra.css b/api/static/api/admin-extra.css similarity index 94% rename from back/api/static/api/admin-extra.css rename to api/static/api/admin-extra.css index cd0a7b84..c40f1b3c 100644 --- a/back/api/static/api/admin-extra.css +++ b/api/static/api/admin-extra.css @@ -1,3 +1,3 @@ -.vTextField { - width: 610px; +.vTextField { + width: 610px; } \ No newline at end of file diff --git a/back/api/static/api/default_metadata_image.png b/api/static/api/default_metadata_image.png similarity index 100% rename from back/api/static/api/default_metadata_image.png rename to api/static/api/default_metadata_image.png diff --git a/back/api/static/api/default_product_thumbnail.png b/api/static/api/default_product_thumbnail.png similarity index 100% rename from back/api/static/api/default_product_thumbnail.png rename to api/static/api/default_product_thumbnail.png diff --git a/back/api/static/api/favicon.ico b/api/static/api/favicon.ico similarity index 100% rename from back/api/static/api/favicon.ico rename to api/static/api/favicon.ico diff --git a/back/api/templates/admin/api/order_change_form.html b/api/templates/admin/api/order_change_form.html similarity index 100% rename from back/api/templates/admin/api/order_change_form.html rename to api/templates/admin/api/order_change_form.html diff --git a/back/api/templates/admin/api/user_change_form.html b/api/templates/admin/api/user_change_form.html similarity index 100% rename from back/api/templates/admin/api/user_change_form.html rename to api/templates/admin/api/user_change_form.html diff --git a/back/api/templates/email_admin_fr-ch.html b/api/templates/email_admin_fr-ch.html similarity index 100% rename from back/api/templates/email_admin_fr-ch.html rename to api/templates/email_admin_fr-ch.html diff --git a/back/api/templates/email_base_template.html b/api/templates/email_base_template.html similarity index 100% rename from back/api/templates/email_base_template.html rename to api/templates/email_base_template.html diff --git a/back/api/templates/email_download_ready_fr-ch.html b/api/templates/email_download_ready_fr-ch.html similarity index 100% rename from back/api/templates/email_download_ready_fr-ch.html rename to api/templates/email_download_ready_fr-ch.html diff --git a/back/api/templates/email_password_reset.html b/api/templates/email_password_reset.html similarity index 100% rename from back/api/templates/email_password_reset.html rename to api/templates/email_password_reset.html diff --git a/back/api/templates/email_quote_done_fr-ch.html b/api/templates/email_quote_done_fr-ch.html similarity index 100% rename from back/api/templates/email_quote_done_fr-ch.html rename to api/templates/email_quote_done_fr-ch.html diff --git a/back/api/templates/email_user_change_fr-ch.html b/api/templates/email_user_change_fr-ch.html similarity index 100% rename from back/api/templates/email_user_change_fr-ch.html rename to api/templates/email_user_change_fr-ch.html diff --git a/back/api/templates/email_user_confirm_fr-ch.html b/api/templates/email_user_confirm_fr-ch.html similarity index 100% rename from back/api/templates/email_user_confirm_fr-ch.html rename to api/templates/email_user_confirm_fr-ch.html diff --git a/back/api/templates/email_validation_needed_fr-ch.html b/api/templates/email_validation_needed_fr-ch.html similarity index 100% rename from back/api/templates/email_validation_needed_fr-ch.html rename to api/templates/email_validation_needed_fr-ch.html diff --git a/back/api/templates/email_welcome_user_fr-ch.html b/api/templates/email_welcome_user_fr-ch.html similarity index 100% rename from back/api/templates/email_welcome_user_fr-ch.html rename to api/templates/email_welcome_user_fr-ch.html diff --git a/api/templates/gis/admin/custom.html b/api/templates/gis/admin/custom.html new file mode 100644 index 00000000..27e8cff8 --- /dev/null +++ b/api/templates/gis/admin/custom.html @@ -0,0 +1,2 @@ +{% extends "gis/admin/openlayers.html" %} +{% block openlayers %}{% include "gis/admin/custom.js" %}{% endblock %} \ No newline at end of file diff --git a/back/api/templates/metadata.html b/api/templates/metadata.html similarity index 100% rename from back/api/templates/metadata.html rename to api/templates/metadata.html diff --git a/back/api/templates/metadata_simple.html b/api/templates/metadata_simple.html similarity index 100% rename from back/api/templates/metadata_simple.html rename to api/templates/metadata_simple.html diff --git a/back/api/templates/rest_framework/api.html b/api/templates/rest_framework/api.html similarity index 95% rename from back/api/templates/rest_framework/api.html rename to api/templates/rest_framework/api.html index 54b3ba28..53218e2f 100644 --- a/back/api/templates/rest_framework/api.html +++ b/api/templates/rest_framework/api.html @@ -1,21 +1,21 @@ -{% extends "rest_framework/base.html" %} -{% load rest_framework %} - -{% block title %}Geoshop API{% endblock %} - -{% block branding %} - - Geoshop API - -{% endblock %} - -{% block userlinks %} -
  • - Admin -
  • - {% if user.is_authenticated %} - {% optional_logout request user %} - {% else %} - {% optional_login request %} - {% endif %} -{% endblock %} +{% extends "rest_framework/base.html" %} +{% load rest_framework %} + +{% block title %}Geoshop API{% endblock %} + +{% block branding %} + + Geoshop API + +{% endblock %} + +{% block userlinks %} +
  • + Admin +
  • + {% if user.is_authenticated %} + {% optional_logout request user %} + {% else %} + {% optional_login request %} + {% endif %} +{% endblock %} diff --git a/back/api/tests/__init__.py b/api/tests/__init__.py similarity index 100% rename from back/api/tests/__init__.py rename to api/tests/__init__.py diff --git a/back/api/tests/factories.py b/api/tests/factories.py similarity index 98% rename from back/api/tests/factories.py rename to api/tests/factories.py index 485189f9..46b62cb8 100644 --- a/back/api/tests/factories.py +++ b/api/tests/factories.py @@ -93,7 +93,7 @@ def __init__(self, webclient=None): ) } - self.provider = UserModel.objects.get(username='sitn_extract') + self.provider = UserModel.objects.get(username='external_provider') self.products = { 'free': Product.objects.create( @@ -197,7 +197,7 @@ def __init__(self, webclient=None): class ExtractFactory: password = os.environ['EXTRACT_USER_PASSWORD'] - username = 'sitn_extract' + username = 'external_provider' def __init__(self, webclient): self.user = UserModel.objects.get(username=self.username) diff --git a/back/api/tests/test_auth.py b/api/tests/test_auth.py similarity index 100% rename from back/api/tests/test_auth.py rename to api/tests/test_auth.py diff --git a/back/api/tests/test_extract.py b/api/tests/test_extract.py similarity index 98% rename from back/api/tests/test_extract.py rename to api/tests/test_extract.py index 1812969a..c613c67e 100644 --- a/back/api/tests/test_extract.py +++ b/api/tests/test_extract.py @@ -43,7 +43,7 @@ def setUp(self): url = reverse('token_obtain_pair') resp = self.client.post( - url, {'username': 'sitn_extract', 'password': os.environ['EXTRACT_USER_PASSWORD']}, format='json') + url, {'username': 'external_provider', 'password': os.environ['EXTRACT_USER_PASSWORD']}, format='json') self.extract_token = resp.data['access'] diff --git a/back/api/tests/test_identity.py b/api/tests/test_identity.py similarity index 100% rename from back/api/tests/test_identity.py rename to api/tests/test_identity.py diff --git a/back/api/tests/test_metadata.py b/api/tests/test_metadata.py similarity index 100% rename from back/api/tests/test_metadata.py rename to api/tests/test_metadata.py diff --git a/back/api/tests/test_order.py b/api/tests/test_order.py similarity index 100% rename from back/api/tests/test_order.py rename to api/tests/test_order.py diff --git a/back/api/tests/test_pricing.py b/api/tests/test_pricing.py similarity index 100% rename from back/api/tests/test_pricing.py rename to api/tests/test_pricing.py diff --git a/back/api/tests/test_product_group.py b/api/tests/test_product_group.py similarity index 100% rename from back/api/tests/test_product_group.py rename to api/tests/test_product_group.py diff --git a/back/api/tests/test_user.py b/api/tests/test_user.py similarity index 100% rename from back/api/tests/test_user.py rename to api/tests/test_user.py diff --git a/back/api/tests/test_user_contact.py b/api/tests/test_user_contact.py similarity index 100% rename from back/api/tests/test_user_contact.py rename to api/tests/test_user_contact.py diff --git a/back/api/tests/test_zip.py b/api/tests/test_zip.py similarity index 100% rename from back/api/tests/test_zip.py rename to api/tests/test_zip.py diff --git a/back/api/views.py b/api/views.py similarity index 99% rename from back/api/views.py rename to api/views.py index c4bf7aaa..95619625 100644 --- a/back/api/views.py +++ b/api/views.py @@ -664,15 +664,3 @@ def post(self, request, *args, **kwargs): confirmation = self.get_object() confirmation.confirm(self.request) return Response({'detail': _('ok')}, status=status.HTTP_200_OK) - - -class VerifyUsernameView(views.APIView): - """ - Verifies if username is available - """ - permission_classes = [permissions.AllowAny] - authentication_classes = [] - allowed_methods = ['GET'] - - #TODO - pass diff --git a/back/.gitignore b/back/.gitignore deleted file mode 100644 index 7baeeef3..00000000 --- a/back/.gitignore +++ /dev/null @@ -1,96 +0,0 @@ -# Created by https://www.gitignore.io - -### OSX ### -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - - -# Thumbnails -._* - -# Files that might appear on external disk -.Spotlight-V100 -.Trashes - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - - -### Python ### -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.cache -nosetests.xml -coverage.xml - -# Translations -*.mo -*.pot - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - - -### Django ### -*.log -*.pot -*.pyc -__pycache__/ -local_settings.py - -.env -.env.local -.env.dev -.env.prod -.env.prepub -db.sqlite3 -.venv -static/* -!static/.gitkeep diff --git a/back/Pipfile b/back/Pipfile deleted file mode 100644 index 2e621579..00000000 --- a/back/Pipfile +++ /dev/null @@ -1,25 +0,0 @@ -[[source]] -name = "pypi" -url = "https://pypi.org/simple" -verify_ssl = true - -[dev-packages] -pylint = "*" -autopep8 = "*" -pylint-django = "*" - -[packages] -django = "==4.1.10" -djangorestframework = "==3.14.0" -markdown = "*" -django-filter = "*" -djangorestframework-gis = "*" -psycopg2 = "==2.9.4" -django-money = "*" -djangorestframework-simplejwt = "==5.2.1" -django-allauth = "*" -django-cors-headers = "*" -python-dotenv = "*" -gunicorn = "*" -whitenoise = "*" -unidecode = "*" diff --git a/back/Pipfile.lock b/back/Pipfile.lock deleted file mode 100644 index b472e281..00000000 --- a/back/Pipfile.lock +++ /dev/null @@ -1,669 +0,0 @@ -{ - "_meta": { - "hash": { - "sha256": "c5e7e615b697ad5663fc43e8ee860e9b0c30f8f88b982345cecc1285a43529bd" - }, - "pipfile-spec": 6, - "requires": {}, - "sources": [ - { - "name": "pypi", - "url": "https://pypi.org/simple", - "verify_ssl": true - } - ] - }, - "default": { - "asgiref": { - "hashes": [ - "sha256:89b2ef2247e3b562a16eef663bc0e2e703ec6468e2fa8a5cd61cd449786d4f6e", - "sha256:9e0ce3aa93a819ba5b45120216b23878cf6e8525eb3848653452b4192b92afed" - ], - "markers": "python_version >= '3.7'", - "version": "==3.7.2" - }, - "babel": { - "hashes": [ - "sha256:b4246fb7677d3b98f501a39d43396d3cafdc8eadb045f4a31be01863f655c610", - "sha256:cc2d99999cd01d44420ae725a21c9e3711b3aadc7976d6147f622d8581963455" - ], - "markers": "python_version >= '3.7'", - "version": "==2.12.1" - }, - "certifi": { - "hashes": [ - "sha256:0f0d56dc5a6ad56fd4ba36484d6cc34451e1c6548c61daad8c320169f91eddc7", - "sha256:c6c2e98f5c7869efca1f8916fed228dd91539f9f1b444c314c06eef02980c716" - ], - "markers": "python_version >= '3.6'", - "version": "==2023.5.7" - }, - "cffi": { - "hashes": [ - "sha256:00a9ed42e88df81ffae7a8ab6d9356b371399b91dbdf0c3cb1e84c03a13aceb5", - "sha256:03425bdae262c76aad70202debd780501fabeaca237cdfddc008987c0e0f59ef", - "sha256:04ed324bda3cda42b9b695d51bb7d54b680b9719cfab04227cdd1e04e5de3104", - "sha256:0e2642fe3142e4cc4af0799748233ad6da94c62a8bec3a6648bf8ee68b1c7426", - "sha256:173379135477dc8cac4bc58f45db08ab45d228b3363adb7af79436135d028405", - "sha256:198caafb44239b60e252492445da556afafc7d1e3ab7a1fb3f0584ef6d742375", - "sha256:1e74c6b51a9ed6589199c787bf5f9875612ca4a8a0785fb2d4a84429badaf22a", - "sha256:2012c72d854c2d03e45d06ae57f40d78e5770d252f195b93f581acf3ba44496e", - "sha256:21157295583fe8943475029ed5abdcf71eb3911894724e360acff1d61c1d54bc", - "sha256:2470043b93ff09bf8fb1d46d1cb756ce6132c54826661a32d4e4d132e1977adf", - "sha256:285d29981935eb726a4399badae8f0ffdff4f5050eaa6d0cfc3f64b857b77185", - "sha256:30d78fbc8ebf9c92c9b7823ee18eb92f2e6ef79b45ac84db507f52fbe3ec4497", - "sha256:320dab6e7cb2eacdf0e658569d2575c4dad258c0fcc794f46215e1e39f90f2c3", - "sha256:33ab79603146aace82c2427da5ca6e58f2b3f2fb5da893ceac0c42218a40be35", - "sha256:3548db281cd7d2561c9ad9984681c95f7b0e38881201e157833a2342c30d5e8c", - "sha256:3799aecf2e17cf585d977b780ce79ff0dc9b78d799fc694221ce814c2c19db83", - "sha256:39d39875251ca8f612b6f33e6b1195af86d1b3e60086068be9cc053aa4376e21", - "sha256:3b926aa83d1edb5aa5b427b4053dc420ec295a08e40911296b9eb1b6170f6cca", - "sha256:3bcde07039e586f91b45c88f8583ea7cf7a0770df3a1649627bf598332cb6984", - "sha256:3d08afd128ddaa624a48cf2b859afef385b720bb4b43df214f85616922e6a5ac", - "sha256:3eb6971dcff08619f8d91607cfc726518b6fa2a9eba42856be181c6d0d9515fd", - "sha256:40f4774f5a9d4f5e344f31a32b5096977b5d48560c5592e2f3d2c4374bd543ee", - "sha256:4289fc34b2f5316fbb762d75362931e351941fa95fa18789191b33fc4cf9504a", - "sha256:470c103ae716238bbe698d67ad020e1db9d9dba34fa5a899b5e21577e6d52ed2", - "sha256:4f2c9f67e9821cad2e5f480bc8d83b8742896f1242dba247911072d4fa94c192", - "sha256:50a74364d85fd319352182ef59c5c790484a336f6db772c1a9231f1c3ed0cbd7", - "sha256:54a2db7b78338edd780e7ef7f9f6c442500fb0d41a5a4ea24fff1c929d5af585", - "sha256:5635bd9cb9731e6d4a1132a498dd34f764034a8ce60cef4f5319c0541159392f", - "sha256:59c0b02d0a6c384d453fece7566d1c7e6b7bae4fc5874ef2ef46d56776d61c9e", - "sha256:5d598b938678ebf3c67377cdd45e09d431369c3b1a5b331058c338e201f12b27", - "sha256:5df2768244d19ab7f60546d0c7c63ce1581f7af8b5de3eb3004b9b6fc8a9f84b", - "sha256:5ef34d190326c3b1f822a5b7a45f6c4535e2f47ed06fec77d3d799c450b2651e", - "sha256:6975a3fac6bc83c4a65c9f9fcab9e47019a11d3d2cf7f3c0d03431bf145a941e", - "sha256:6c9a799e985904922a4d207a94eae35c78ebae90e128f0c4e521ce339396be9d", - "sha256:70df4e3b545a17496c9b3f41f5115e69a4f2e77e94e1d2a8e1070bc0c38c8a3c", - "sha256:7473e861101c9e72452f9bf8acb984947aa1661a7704553a9f6e4baa5ba64415", - "sha256:8102eaf27e1e448db915d08afa8b41d6c7ca7a04b7d73af6514df10a3e74bd82", - "sha256:87c450779d0914f2861b8526e035c5e6da0a3199d8f1add1a665e1cbc6fc6d02", - "sha256:8b7ee99e510d7b66cdb6c593f21c043c248537a32e0bedf02e01e9553a172314", - "sha256:91fc98adde3d7881af9b59ed0294046f3806221863722ba7d8d120c575314325", - "sha256:94411f22c3985acaec6f83c6df553f2dbe17b698cc7f8ae751ff2237d96b9e3c", - "sha256:98d85c6a2bef81588d9227dde12db8a7f47f639f4a17c9ae08e773aa9c697bf3", - "sha256:9ad5db27f9cabae298d151c85cf2bad1d359a1b9c686a275df03385758e2f914", - "sha256:a0b71b1b8fbf2b96e41c4d990244165e2c9be83d54962a9a1d118fd8657d2045", - "sha256:a0f100c8912c114ff53e1202d0078b425bee3649ae34d7b070e9697f93c5d52d", - "sha256:a591fe9e525846e4d154205572a029f653ada1a78b93697f3b5a8f1f2bc055b9", - "sha256:a5c84c68147988265e60416b57fc83425a78058853509c1b0629c180094904a5", - "sha256:a66d3508133af6e8548451b25058d5812812ec3798c886bf38ed24a98216fab2", - "sha256:a8c4917bd7ad33e8eb21e9a5bbba979b49d9a97acb3a803092cbc1133e20343c", - "sha256:b3bbeb01c2b273cca1e1e0c5df57f12dce9a4dd331b4fa1635b8bec26350bde3", - "sha256:cba9d6b9a7d64d4bd46167096fc9d2f835e25d7e4c121fb2ddfc6528fb0413b2", - "sha256:cc4d65aeeaa04136a12677d3dd0b1c0c94dc43abac5860ab33cceb42b801c1e8", - "sha256:ce4bcc037df4fc5e3d184794f27bdaab018943698f4ca31630bc7f84a7b69c6d", - "sha256:cec7d9412a9102bdc577382c3929b337320c4c4c4849f2c5cdd14d7368c5562d", - "sha256:d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9", - "sha256:d61f4695e6c866a23a21acab0509af1cdfd2c013cf256bbf5b6b5e2695827162", - "sha256:db0fbb9c62743ce59a9ff687eb5f4afbe77e5e8403d6697f7446e5f609976f76", - "sha256:dd86c085fae2efd48ac91dd7ccffcfc0571387fe1193d33b6394db7ef31fe2a4", - "sha256:e00b098126fd45523dd056d2efba6c5a63b71ffe9f2bbe1a4fe1716e1d0c331e", - "sha256:e229a521186c75c8ad9490854fd8bbdd9a0c9aa3a524326b55be83b54d4e0ad9", - "sha256:e263d77ee3dd201c3a142934a086a4450861778baaeeb45db4591ef65550b0a6", - "sha256:ed9cb427ba5504c1dc15ede7d516b84757c3e3d7868ccc85121d9310d27eed0b", - "sha256:fa6693661a4c91757f4412306191b6dc88c1703f780c8234035eac011922bc01", - "sha256:fcd131dd944808b5bdb38e6f5b53013c5aa4f334c5cad0c72742f6eba4b73db0" - ], - "version": "==1.15.1" - }, - "charset-normalizer": { - "hashes": [ - "sha256:04afa6387e2b282cf78ff3dbce20f0cc071c12dc8f685bd40960cc68644cfea6", - "sha256:04eefcee095f58eaabe6dc3cc2262f3bcd776d2c67005880894f447b3f2cb9c1", - "sha256:0be65ccf618c1e7ac9b849c315cc2e8a8751d9cfdaa43027d4f6624bd587ab7e", - "sha256:0c95f12b74681e9ae127728f7e5409cbbef9cd914d5896ef238cc779b8152373", - "sha256:0ca564606d2caafb0abe6d1b5311c2649e8071eb241b2d64e75a0d0065107e62", - "sha256:10c93628d7497c81686e8e5e557aafa78f230cd9e77dd0c40032ef90c18f2230", - "sha256:11d117e6c63e8f495412d37e7dc2e2fff09c34b2d09dbe2bee3c6229577818be", - "sha256:11d3bcb7be35e7b1bba2c23beedac81ee893ac9871d0ba79effc7fc01167db6c", - "sha256:12a2b561af122e3d94cdb97fe6fb2bb2b82cef0cdca131646fdb940a1eda04f0", - "sha256:12d1a39aa6b8c6f6248bb54550efcc1c38ce0d8096a146638fd4738e42284448", - "sha256:1435ae15108b1cb6fffbcea2af3d468683b7afed0169ad718451f8db5d1aff6f", - "sha256:1c60b9c202d00052183c9be85e5eaf18a4ada0a47d188a83c8f5c5b23252f649", - "sha256:1e8fcdd8f672a1c4fc8d0bd3a2b576b152d2a349782d1eb0f6b8e52e9954731d", - "sha256:20064ead0717cf9a73a6d1e779b23d149b53daf971169289ed2ed43a71e8d3b0", - "sha256:21fa558996782fc226b529fdd2ed7866c2c6ec91cee82735c98a197fae39f706", - "sha256:22908891a380d50738e1f978667536f6c6b526a2064156203d418f4856d6e86a", - "sha256:3160a0fd9754aab7d47f95a6b63ab355388d890163eb03b2d2b87ab0a30cfa59", - "sha256:322102cdf1ab682ecc7d9b1c5eed4ec59657a65e1c146a0da342b78f4112db23", - "sha256:34e0a2f9c370eb95597aae63bf85eb5e96826d81e3dcf88b8886012906f509b5", - "sha256:3573d376454d956553c356df45bb824262c397c6e26ce43e8203c4c540ee0acb", - "sha256:3747443b6a904001473370d7810aa19c3a180ccd52a7157aacc264a5ac79265e", - "sha256:38e812a197bf8e71a59fe55b757a84c1f946d0ac114acafaafaf21667a7e169e", - "sha256:3a06f32c9634a8705f4ca9946d667609f52cf130d5548881401f1eb2c39b1e2c", - "sha256:3a5fc78f9e3f501a1614a98f7c54d3969f3ad9bba8ba3d9b438c3bc5d047dd28", - "sha256:3d9098b479e78c85080c98e1e35ff40b4a31d8953102bb0fd7d1b6f8a2111a3d", - "sha256:3dc5b6a8ecfdc5748a7e429782598e4f17ef378e3e272eeb1340ea57c9109f41", - "sha256:4155b51ae05ed47199dc5b2a4e62abccb274cee6b01da5b895099b61b1982974", - "sha256:49919f8400b5e49e961f320c735388ee686a62327e773fa5b3ce6721f7e785ce", - "sha256:53d0a3fa5f8af98a1e261de6a3943ca631c526635eb5817a87a59d9a57ebf48f", - "sha256:5f008525e02908b20e04707a4f704cd286d94718f48bb33edddc7d7b584dddc1", - "sha256:628c985afb2c7d27a4800bfb609e03985aaecb42f955049957814e0491d4006d", - "sha256:65ed923f84a6844de5fd29726b888e58c62820e0769b76565480e1fdc3d062f8", - "sha256:6734e606355834f13445b6adc38b53c0fd45f1a56a9ba06c2058f86893ae8017", - "sha256:6baf0baf0d5d265fa7944feb9f7451cc316bfe30e8df1a61b1bb08577c554f31", - "sha256:6f4f4668e1831850ebcc2fd0b1cd11721947b6dc7c00bf1c6bd3c929ae14f2c7", - "sha256:6f5c2e7bc8a4bf7c426599765b1bd33217ec84023033672c1e9a8b35eaeaaaf8", - "sha256:6f6c7a8a57e9405cad7485f4c9d3172ae486cfef1344b5ddd8e5239582d7355e", - "sha256:7381c66e0561c5757ffe616af869b916c8b4e42b367ab29fedc98481d1e74e14", - "sha256:73dc03a6a7e30b7edc5b01b601e53e7fc924b04e1835e8e407c12c037e81adbd", - "sha256:74db0052d985cf37fa111828d0dd230776ac99c740e1a758ad99094be4f1803d", - "sha256:75f2568b4189dda1c567339b48cba4ac7384accb9c2a7ed655cd86b04055c795", - "sha256:78cacd03e79d009d95635e7d6ff12c21eb89b894c354bd2b2ed0b4763373693b", - "sha256:80d1543d58bd3d6c271b66abf454d437a438dff01c3e62fdbcd68f2a11310d4b", - "sha256:830d2948a5ec37c386d3170c483063798d7879037492540f10a475e3fd6f244b", - "sha256:891cf9b48776b5c61c700b55a598621fdb7b1e301a550365571e9624f270c203", - "sha256:8f25e17ab3039b05f762b0a55ae0b3632b2e073d9c8fc88e89aca31a6198e88f", - "sha256:9a3267620866c9d17b959a84dd0bd2d45719b817245e49371ead79ed4f710d19", - "sha256:a04f86f41a8916fe45ac5024ec477f41f886b3c435da2d4e3d2709b22ab02af1", - "sha256:aaf53a6cebad0eae578f062c7d462155eada9c172bd8c4d250b8c1d8eb7f916a", - "sha256:abc1185d79f47c0a7aaf7e2412a0eb2c03b724581139193d2d82b3ad8cbb00ac", - "sha256:ac0aa6cd53ab9a31d397f8303f92c42f534693528fafbdb997c82bae6e477ad9", - "sha256:ac3775e3311661d4adace3697a52ac0bab17edd166087d493b52d4f4f553f9f0", - "sha256:b06f0d3bf045158d2fb8837c5785fe9ff9b8c93358be64461a1089f5da983137", - "sha256:b116502087ce8a6b7a5f1814568ccbd0e9f6cfd99948aa59b0e241dc57cf739f", - "sha256:b82fab78e0b1329e183a65260581de4375f619167478dddab510c6c6fb04d9b6", - "sha256:bd7163182133c0c7701b25e604cf1611c0d87712e56e88e7ee5d72deab3e76b5", - "sha256:c36bcbc0d5174a80d6cccf43a0ecaca44e81d25be4b7f90f0ed7bcfbb5a00909", - "sha256:c3af8e0f07399d3176b179f2e2634c3ce9c1301379a6b8c9c9aeecd481da494f", - "sha256:c84132a54c750fda57729d1e2599bb598f5fa0344085dbde5003ba429a4798c0", - "sha256:cb7b2ab0188829593b9de646545175547a70d9a6e2b63bf2cd87a0a391599324", - "sha256:cca4def576f47a09a943666b8f829606bcb17e2bc2d5911a46c8f8da45f56755", - "sha256:cf6511efa4801b9b38dc5546d7547d5b5c6ef4b081c60b23e4d941d0eba9cbeb", - "sha256:d16fd5252f883eb074ca55cb622bc0bee49b979ae4e8639fff6ca3ff44f9f854", - "sha256:d2686f91611f9e17f4548dbf050e75b079bbc2a82be565832bc8ea9047b61c8c", - "sha256:d7fc3fca01da18fbabe4625d64bb612b533533ed10045a2ac3dd194bfa656b60", - "sha256:dd5653e67b149503c68c4018bf07e42eeed6b4e956b24c00ccdf93ac79cdff84", - "sha256:de5695a6f1d8340b12a5d6d4484290ee74d61e467c39ff03b39e30df62cf83a0", - "sha256:e0ac8959c929593fee38da1c2b64ee9778733cdf03c482c9ff1d508b6b593b2b", - "sha256:e1b25e3ad6c909f398df8921780d6a3d120d8c09466720226fc621605b6f92b1", - "sha256:e633940f28c1e913615fd624fcdd72fdba807bf53ea6925d6a588e84e1151531", - "sha256:e89df2958e5159b811af9ff0f92614dabf4ff617c03a4c1c6ff53bf1c399e0e1", - "sha256:ea9f9c6034ea2d93d9147818f17c2a0860d41b71c38b9ce4d55f21b6f9165a11", - "sha256:f645caaf0008bacf349875a974220f1f1da349c5dbe7c4ec93048cdc785a3326", - "sha256:f8303414c7b03f794347ad062c0516cee0e15f7a612abd0ce1e25caf6ceb47df", - "sha256:fca62a8301b605b954ad2e9c3666f9d97f63872aa4efcae5492baca2056b74ab" - ], - "markers": "python_version >= '3.7'", - "version": "==3.1.0" - }, - "cryptography": { - "hashes": [ - "sha256:059e348f9a3c1950937e1b5d7ba1f8e968508ab181e75fc32b879452f08356db", - "sha256:1a5472d40c8f8e91ff7a3d8ac6dfa363d8e3138b961529c996f3e2df0c7a411a", - "sha256:1a8e6c2de6fbbcc5e14fd27fb24414507cb3333198ea9ab1258d916f00bc3039", - "sha256:1fee5aacc7367487b4e22484d3c7e547992ed726d14864ee33c0176ae43b0d7c", - "sha256:5d092fdfedaec4cbbffbf98cddc915ba145313a6fdaab83c6e67f4e6c218e6f3", - "sha256:5f0ff6e18d13a3de56f609dd1fd11470918f770c6bd5d00d632076c727d35485", - "sha256:7bfc55a5eae8b86a287747053140ba221afc65eb06207bedf6e019b8934b477c", - "sha256:7fa01527046ca5facdf973eef2535a27fec4cb651e4daec4d043ef63f6ecd4ca", - "sha256:8dde71c4169ec5ccc1087bb7521d54251c016f126f922ab2dfe6649170a3b8c5", - "sha256:8f4ab7021127a9b4323537300a2acfb450124b2def3756f64dc3a3d2160ee4b5", - "sha256:948224d76c4b6457349d47c0c98657557f429b4e93057cf5a2f71d603e2fc3a3", - "sha256:9a6c7a3c87d595608a39980ebaa04d5a37f94024c9f24eb7d10262b92f739ddb", - "sha256:b46e37db3cc267b4dea1f56da7346c9727e1209aa98487179ee8ebed09d21e43", - "sha256:b4ceb5324b998ce2003bc17d519080b4ec8d5b7b70794cbd2836101406a9be31", - "sha256:cb33ccf15e89f7ed89b235cff9d49e2e62c6c981a6061c9c8bb47ed7951190bc", - "sha256:d198820aba55660b4d74f7b5fd1f17db3aa5eb3e6893b0a41b75e84e4f9e0e4b", - "sha256:d34579085401d3f49762d2f7d6634d6b6c2ae1242202e860f4d26b046e3a1006", - "sha256:eb8163f5e549a22888c18b0d53d6bb62a20510060a22fd5a995ec8a05268df8a", - "sha256:f73bff05db2a3e5974a6fd248af2566134d8981fd7ab012e5dd4ddb1d9a70699" - ], - "version": "==41.0.1" - }, - "defusedxml": { - "hashes": [ - "sha256:1bb3032db185915b62d7c6209c5a8792be6a32ab2fedacc84e01b52c51aa3e69", - "sha256:a352e7e428770286cc899e2542b6cdaedb2b4953ff269a210103ec58f6198a61" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", - "version": "==0.7.1" - }, - "django": { - "hashes": [ - "sha256:26d0260c2fb8121009e62ffc548b2398dea2522b6454208a852fb0ef264c206c", - "sha256:56343019a9fd839e2e5bf203daf45f25af79d5bffa4c71d56eae4f4404d82ade" - ], - "index": "pypi", - "version": "==4.1.10" - }, - "django-allauth": { - "hashes": [ - "sha256:ca1622733b6faa591580ccd3984042f12d8c79ade93438212de249b7ffb6f91f" - ], - "index": "pypi", - "version": "==0.51.0" - }, - "django-cors-headers": { - "hashes": [ - "sha256:37e42883b5f1f2295df6b4bba96eb2417a14a03270cb24b2a07f021cd4487cf4", - "sha256:f9dc6b4e3f611c3199700b3e5f3398c28757dcd559c2f82932687f3d0443cfdf" - ], - "index": "pypi", - "version": "==3.13.0" - }, - "django-filter": { - "hashes": [ - "sha256:ed429e34760127e3520a67f415bec4c905d4649fbe45d0d6da37e6ff5e0287eb", - "sha256:ed473b76e84f7e83b2511bb2050c3efb36d135207d0128dfe3ae4b36e3594ba5" - ], - "index": "pypi", - "version": "==22.1" - }, - "django-money": { - "hashes": [ - "sha256:1f2a760d5da28de8e1beb05bfc66db0c29b4329c7e382cf69f2577315da3ee91", - "sha256:4213604537d0e61abb5a7bbb39f0c90bd347a6605c67e96868f5fa9fbbe40278" - ], - "index": "pypi", - "version": "==3.0.0" - }, - "djangorestframework": { - "hashes": [ - "sha256:579a333e6256b09489cbe0a067e66abe55c6595d8926be6b99423786334350c8", - "sha256:eb63f58c9f218e1a7d064d17a70751f528ed4e1d35547fdade9aaf4cd103fd08" - ], - "index": "pypi", - "version": "==3.14.0" - }, - "djangorestframework-gis": { - "hashes": [ - "sha256:921c5adbc9a7c0502c905957a6695b67f55d7bf6582e1ab837888b55a1fce5a6", - "sha256:bb715f05a111c02b9acc4021b17566e40c0b90dd833c583bac3d67f92be9667d" - ], - "index": "pypi", - "version": "==1.0" - }, - "djangorestframework-simplejwt": { - "hashes": [ - "sha256:1965246979f521c24a3be81d305c3df40bb564e136823868aebc1a1b16e51b8c", - "sha256:7613874c322a3f6e330cc118f9f00a3db957fea7f8e3bed81ba451853cd1dbd5" - ], - "index": "pypi", - "version": "==5.2.1" - }, - "gunicorn": { - "hashes": [ - "sha256:9dcc4547dbb1cb284accfb15ab5667a0e5d1881cc443e0677b4882a4067a807e", - "sha256:e0a968b5ba15f8a328fdfd7ab1fcb5af4470c28aaf7e55df02a99bc13138e6e8" - ], - "index": "pypi", - "version": "==20.1.0" - }, - "idna": { - "hashes": [ - "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4", - "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2" - ], - "markers": "python_version >= '3.5'", - "version": "==3.4" - }, - "markdown": { - "hashes": [ - "sha256:08fb8465cffd03d10b9dd34a5c3fea908e20391a2a90b88d66362cb05beed186", - "sha256:3b809086bb6efad416156e00a0da66fe47618a5d6918dd688f53f40c8e4cfeff" - ], - "index": "pypi", - "version": "==3.4.1" - }, - "oauthlib": { - "hashes": [ - "sha256:8139f29aac13e25d502680e9e19963e83f16838d48a0d71c287fe40e7067fbca", - "sha256:9859c40929662bec5d64f34d01c99e093149682a3f38915dc0655d5a633dd918" - ], - "markers": "python_version >= '3.6'", - "version": "==3.2.2" - }, - "psycopg2": { - "hashes": [ - "sha256:07b90a24d5056687781ddaef0ea172fd951f2f7293f6ffdd03d4f5077801f426", - "sha256:1da77c061bdaab450581458932ae5e469cc6e36e0d62f988376e9f513f11cb5c", - "sha256:46361c054df612c3cc813fdb343733d56543fb93565cff0f8ace422e4da06acb", - "sha256:839f9ea8f6098e39966d97fcb8d08548fbc57c523a1e27a1f0609addf40f777c", - "sha256:849bd868ae3369932127f0771c08d1109b254f08d48dc42493c3d1b87cb2d308", - "sha256:8de6a9fc5f42fa52f559e65120dcd7502394692490c98fed1221acf0819d7797", - "sha256:a11946bad3557ca254f17357d5a4ed63bdca45163e7a7d2bfb8e695df069cc3a", - "sha256:aa184d551a767ad25df3b8d22a0a62ef2962e0e374c04f6cbd1204947f540d61", - "sha256:aafa96f2da0071d6dd0cbb7633406d99f414b40ab0f918c9d9af7df928a1accb", - "sha256:c7fa041b4acb913f6968fce10169105af5200f296028251d817ab37847c30184", - "sha256:d529926254e093a1b669f692a3aa50069bc71faf5b0ecd91686a78f62767d52f" - ], - "index": "pypi", - "version": "==2.9.4" - }, - "py-moneyed": { - "hashes": [ - "sha256:1fafe552cfa3cba579d026924c27b070d71b4140e50ef4535e4083b3f4f2473f", - "sha256:a56e1987deacb2e0eac5904552699a5d3fa251042e528bf2ff74a72359f5e5b3" - ], - "markers": "python_version >= '3.6'", - "version": "==2.0" - }, - "pycparser": { - "hashes": [ - "sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9", - "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206" - ], - "version": "==2.21" - }, - "pyjwt": { - "extras": [ - "crypto" - ], - "hashes": [ - "sha256:ba2b425b15ad5ef12f200dc67dd56af4e26de2331f965c5439994dad075876e1", - "sha256:bd6ca4a3c4285c1a2d4349e5a035fdf8fb94e04ccd0fcbe6ba289dae9cc3e074" - ], - "markers": "python_version >= '3.7'", - "version": "==2.7.0" - }, - "python-dotenv": { - "hashes": [ - "sha256:1684eb44636dd462b66c3ee016599815514527ad99965de77f43e0944634a7e5", - "sha256:b77d08274639e3d34145dfa6c7008e66df0f04b7be7a75fd0d5292c191d79045" - ], - "index": "pypi", - "version": "==0.21.0" - }, - "python3-openid": { - "hashes": [ - "sha256:33fbf6928f401e0b790151ed2b5290b02545e8775f982485205a066f874aaeaf", - "sha256:6626f771e0417486701e0b4daff762e7212e820ca5b29fcc0d05f6f8736dfa6b" - ], - "version": "==3.2.0" - }, - "pytz": { - "hashes": [ - "sha256:1d8ce29db189191fb55338ee6d0387d82ab59f3d00eac103412d64e0ebd0c588", - "sha256:a151b3abb88eda1d4e34a9814df37de2a80e301e68ba0fd856fb9b46bfbbbffb" - ], - "version": "==2023.3" - }, - "requests": { - "hashes": [ - "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f", - "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1" - ], - "markers": "python_version >= '3.7'", - "version": "==2.31.0" - }, - "requests-oauthlib": { - "hashes": [ - "sha256:2577c501a2fb8d05a304c09d090d6e47c306fef15809d102b327cf8364bddab5", - "sha256:75beac4a47881eeb94d5ea5d6ad31ef88856affe2332b9aafb52c6452ccf0d7a" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==1.3.1" - }, - "setuptools": { - "hashes": [ - "sha256:11e52c67415a381d10d6b462ced9cfb97066179f0e871399e006c4ab101fc85f", - "sha256:baf1fdb41c6da4cd2eae722e135500da913332ab3f2f5c7d33af9b492acb5235" - ], - "markers": "python_version >= '3.7'", - "version": "==68.0.0" - }, - "sqlparse": { - "hashes": [ - "sha256:5430a4fe2ac7d0f93e66f1efc6e1338a41884b7ddf2a350cedd20ccc4d9d28f3", - "sha256:d446183e84b8349fa3061f0fe7f06ca94ba65b426946ffebe6e3e8295332420c" - ], - "markers": "python_version >= '3.5'", - "version": "==0.4.4" - }, - "typing-extensions": { - "hashes": [ - "sha256:440d5dd3af93b060174bf433bccd69b0babc3b15b1a8dca43789fd7f61514b36", - "sha256:b75ddc264f0ba5615db7ba217daeb99701ad295353c45f9e95963337ceeeffb2" - ], - "markers": "python_version >= '3.7'", - "version": "==4.7.1" - }, - "unidecode": { - "hashes": [ - "sha256:547d7c479e4f377b430dd91ac1275d593308dce0fc464fb2ab7d41f82ec653be", - "sha256:fed09cf0be8cf415b391642c2a5addfc72194407caee4f98719e40ec2a72b830" - ], - "index": "pypi", - "version": "==1.3.6" - }, - "urllib3": { - "hashes": [ - "sha256:48e7fafa40319d358848e1bc6809b208340fafe2096f1725d05d67443d0483d1", - "sha256:bee28b5e56addb8226c96f7f13ac28cb4c301dd5ea8a6ca179c0b9835e032825" - ], - "markers": "python_version >= '3.7'", - "version": "==2.0.3" - }, - "whitenoise": { - "hashes": [ - "sha256:8e9c600a5c18bd17655ef668ad55b5edf6c24ce9bdca5bf607649ca4b1e8e2c2", - "sha256:8fa943c6d4cd9e27673b70c21a07b0aa120873901e099cd46cab40f7cc96d567" - ], - "index": "pypi", - "version": "==6.2.0" - } - }, - "develop": { - "astroid": { - "hashes": [ - "sha256:6891f444625b6edb2ac798829b689e95297e100ddf89dbed5a8c610e34901501", - "sha256:df164d5ac811b9f44105a72b8f9d5edfb7b5b2d7e979b04ea377a77b3229114a" - ], - "markers": "python_full_version >= '3.7.2'", - "version": "==2.13.5" - }, - "autopep8": { - "hashes": [ - "sha256:6f09e90a2be784317e84dc1add17ebfc7abe3924239957a37e5040e27d812087", - "sha256:ca9b1a83e53a7fad65d731dc7a2a2d50aa48f43850407c59f6a1a306c4201142" - ], - "index": "pypi", - "version": "==1.7.0" - }, - "dill": { - "hashes": [ - "sha256:a07ffd2351b8c678dfc4a856a3005f8067aea51d6ba6c700796a4d9e280f39f0", - "sha256:e5db55f3687856d8fbdab002ed78544e1c4559a130302693d839dfe8f93f2373" - ], - "markers": "python_version >= '3.7'", - "version": "==0.3.6" - }, - "isort": { - "hashes": [ - "sha256:8bef7dde241278824a6d83f44a544709b065191b95b6e50894bdc722fcba0504", - "sha256:f84c2818376e66cf843d497486ea8fed8700b340f308f076c6fb1229dff318b6" - ], - "markers": "python_full_version >= '3.8.0'", - "version": "==5.12.0" - }, - "lazy-object-proxy": { - "hashes": [ - "sha256:09763491ce220c0299688940f8dc2c5d05fd1f45af1e42e636b2e8b2303e4382", - "sha256:0a891e4e41b54fd5b8313b96399f8b0e173bbbfc03c7631f01efbe29bb0bcf82", - "sha256:189bbd5d41ae7a498397287c408617fe5c48633e7755287b21d741f7db2706a9", - "sha256:18b78ec83edbbeb69efdc0e9c1cb41a3b1b1ed11ddd8ded602464c3fc6020494", - "sha256:1aa3de4088c89a1b69f8ec0dcc169aa725b0ff017899ac568fe44ddc1396df46", - "sha256:212774e4dfa851e74d393a2370871e174d7ff0ebc980907723bb67d25c8a7c30", - "sha256:2d0daa332786cf3bb49e10dc6a17a52f6a8f9601b4cf5c295a4f85854d61de63", - "sha256:5f83ac4d83ef0ab017683d715ed356e30dd48a93746309c8f3517e1287523ef4", - "sha256:659fb5809fa4629b8a1ac5106f669cfc7bef26fbb389dda53b3e010d1ac4ebae", - "sha256:660c94ea760b3ce47d1855a30984c78327500493d396eac4dfd8bd82041b22be", - "sha256:66a3de4a3ec06cd8af3f61b8e1ec67614fbb7c995d02fa224813cb7afefee701", - "sha256:721532711daa7db0d8b779b0bb0318fa87af1c10d7fe5e52ef30f8eff254d0cd", - "sha256:7322c3d6f1766d4ef1e51a465f47955f1e8123caee67dd641e67d539a534d006", - "sha256:79a31b086e7e68b24b99b23d57723ef7e2c6d81ed21007b6281ebcd1688acb0a", - "sha256:81fc4d08b062b535d95c9ea70dbe8a335c45c04029878e62d744bdced5141586", - "sha256:8fa02eaab317b1e9e03f69aab1f91e120e7899b392c4fc19807a8278a07a97e8", - "sha256:9090d8e53235aa280fc9239a86ae3ea8ac58eff66a705fa6aa2ec4968b95c821", - "sha256:946d27deaff6cf8452ed0dba83ba38839a87f4f7a9732e8f9fd4107b21e6ff07", - "sha256:9990d8e71b9f6488e91ad25f322898c136b008d87bf852ff65391b004da5e17b", - "sha256:9cd077f3d04a58e83d04b20e334f678c2b0ff9879b9375ed107d5d07ff160171", - "sha256:9e7551208b2aded9c1447453ee366f1c4070602b3d932ace044715d89666899b", - "sha256:9f5fa4a61ce2438267163891961cfd5e32ec97a2c444e5b842d574251ade27d2", - "sha256:b40387277b0ed2d0602b8293b94d7257e17d1479e257b4de114ea11a8cb7f2d7", - "sha256:bfb38f9ffb53b942f2b5954e0f610f1e721ccebe9cce9025a38c8ccf4a5183a4", - "sha256:cbf9b082426036e19c6924a9ce90c740a9861e2bdc27a4834fd0a910742ac1e8", - "sha256:d9e25ef10a39e8afe59a5c348a4dbf29b4868ab76269f81ce1674494e2565a6e", - "sha256:db1c1722726f47e10e0b5fdbf15ac3b8adb58c091d12b3ab713965795036985f", - "sha256:e7c21c95cae3c05c14aafffe2865bbd5e377cfc1348c4f7751d9dc9a48ca4bda", - "sha256:e8c6cfb338b133fbdbc5cfaa10fe3c6aeea827db80c978dbd13bc9dd8526b7d4", - "sha256:ea806fd4c37bf7e7ad82537b0757999264d5f70c45468447bb2b91afdbe73a6e", - "sha256:edd20c5a55acb67c7ed471fa2b5fb66cb17f61430b7a6b9c3b4a1e40293b1671", - "sha256:f0117049dd1d5635bbff65444496c90e0baa48ea405125c088e93d9cf4525b11", - "sha256:f0705c376533ed2a9e5e97aacdbfe04cecd71e0aa84c7c0595d02ef93b6e4455", - "sha256:f12ad7126ae0c98d601a7ee504c1122bcef553d1d5e0c3bfa77b16b3968d2734", - "sha256:f2457189d8257dd41ae9b434ba33298aec198e30adf2dcdaaa3a28b9994f6adb", - "sha256:f699ac1c768270c9e384e4cbd268d6e67aebcfae6cd623b4d7c3bfde5a35db59" - ], - "markers": "python_version >= '3.7'", - "version": "==1.9.0" - }, - "mccabe": { - "hashes": [ - "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325", - "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e" - ], - "markers": "python_version >= '3.6'", - "version": "==0.7.0" - }, - "platformdirs": { - "hashes": [ - "sha256:b0cabcb11063d21a0b261d557acb0a9d2126350e63b70cdf7db6347baea456dc", - "sha256:ca9ed98ce73076ba72e092b23d3c93ea6c4e186b3f1c3dad6edd98ff6ffcca2e" - ], - "markers": "python_version >= '3.7'", - "version": "==3.8.0" - }, - "pycodestyle": { - "hashes": [ - "sha256:347187bdb476329d98f695c213d7295a846d1152ff4fe9bacb8a9590b8ee7053", - "sha256:8a4eaf0d0495c7395bdab3589ac2db602797d76207242c17d470186815706610" - ], - "markers": "python_version >= '3.6'", - "version": "==2.10.0" - }, - "pylint": { - "hashes": [ - "sha256:5441e9294335d354b7bad57c1044e5bd7cce25c433475d76b440e53452fa5cb8", - "sha256:629cf1dbdfb6609d7e7a45815a8bb59300e34aa35783b5ac563acaca2c4022e9" - ], - "index": "pypi", - "version": "==2.15.4" - }, - "pylint-django": { - "hashes": [ - "sha256:0ac090d106c62fe33782a1d01bda1610b761bb1c9bf5035ced9d5f23a13d8591", - "sha256:56b12b6adf56d548412445bd35483034394a1a94901c3f8571980a13882299d5" - ], - "index": "pypi", - "version": "==2.5.3" - }, - "pylint-plugin-utils": { - "hashes": [ - "sha256:ae11664737aa2effbf26f973a9e0b6779ab7106ec0adc5fe104b0907ca04e507", - "sha256:d3cebf68a38ba3fba23a873809155562571386d4c1b03e5b4c4cc26c3eee93e4" - ], - "markers": "python_version >= '3.7' and python_version < '4.0'", - "version": "==0.8.2" - }, - "toml": { - "hashes": [ - "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b", - "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f" - ], - "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==0.10.2" - }, - "tomlkit": { - "hashes": [ - "sha256:8c726c4c202bdb148667835f68d68780b9a003a9ec34167b6c673b38eff2a171", - "sha256:9330fc7faa1db67b541b28e62018c17d20be733177d290a13b24c62d1614e0c3" - ], - "markers": "python_version >= '3.7'", - "version": "==0.11.8" - }, - "wrapt": { - "hashes": [ - "sha256:02fce1852f755f44f95af51f69d22e45080102e9d00258053b79367d07af39c0", - "sha256:077ff0d1f9d9e4ce6476c1a924a3332452c1406e59d90a2cf24aeb29eeac9420", - "sha256:078e2a1a86544e644a68422f881c48b84fef6d18f8c7a957ffd3f2e0a74a0d4a", - "sha256:0970ddb69bba00670e58955f8019bec4a42d1785db3faa043c33d81de2bf843c", - "sha256:1286eb30261894e4c70d124d44b7fd07825340869945c79d05bda53a40caa079", - "sha256:21f6d9a0d5b3a207cdf7acf8e58d7d13d463e639f0c7e01d82cdb671e6cb7923", - "sha256:230ae493696a371f1dbffaad3dafbb742a4d27a0afd2b1aecebe52b740167e7f", - "sha256:26458da5653aa5b3d8dc8b24192f574a58984c749401f98fff994d41d3f08da1", - "sha256:2cf56d0e237280baed46f0b5316661da892565ff58309d4d2ed7dba763d984b8", - "sha256:2e51de54d4fb8fb50d6ee8327f9828306a959ae394d3e01a1ba8b2f937747d86", - "sha256:2fbfbca668dd15b744418265a9607baa970c347eefd0db6a518aaf0cfbd153c0", - "sha256:38adf7198f8f154502883242f9fe7333ab05a5b02de7d83aa2d88ea621f13364", - "sha256:3a8564f283394634a7a7054b7983e47dbf39c07712d7b177b37e03f2467a024e", - "sha256:3abbe948c3cbde2689370a262a8d04e32ec2dd4f27103669a45c6929bcdbfe7c", - "sha256:3bbe623731d03b186b3d6b0d6f51865bf598587c38d6f7b0be2e27414f7f214e", - "sha256:40737a081d7497efea35ab9304b829b857f21558acfc7b3272f908d33b0d9d4c", - "sha256:41d07d029dd4157ae27beab04d22b8e261eddfc6ecd64ff7000b10dc8b3a5727", - "sha256:46ed616d5fb42f98630ed70c3529541408166c22cdfd4540b88d5f21006b0eff", - "sha256:493d389a2b63c88ad56cdc35d0fa5752daac56ca755805b1b0c530f785767d5e", - "sha256:4ff0d20f2e670800d3ed2b220d40984162089a6e2c9646fdb09b85e6f9a8fc29", - "sha256:54accd4b8bc202966bafafd16e69da9d5640ff92389d33d28555c5fd4f25ccb7", - "sha256:56374914b132c702aa9aa9959c550004b8847148f95e1b824772d453ac204a72", - "sha256:578383d740457fa790fdf85e6d346fda1416a40549fe8db08e5e9bd281c6a475", - "sha256:58d7a75d731e8c63614222bcb21dd992b4ab01a399f1f09dd82af17bbfc2368a", - "sha256:5c5aa28df055697d7c37d2099a7bc09f559d5053c3349b1ad0c39000e611d317", - "sha256:5fc8e02f5984a55d2c653f5fea93531e9836abbd84342c1d1e17abc4a15084c2", - "sha256:63424c681923b9f3bfbc5e3205aafe790904053d42ddcc08542181a30a7a51bd", - "sha256:64b1df0f83706b4ef4cfb4fb0e4c2669100fd7ecacfb59e091fad300d4e04640", - "sha256:74934ebd71950e3db69960a7da29204f89624dde411afbfb3b4858c1409b1e98", - "sha256:75669d77bb2c071333417617a235324a1618dba66f82a750362eccbe5b61d248", - "sha256:75760a47c06b5974aa5e01949bf7e66d2af4d08cb8c1d6516af5e39595397f5e", - "sha256:76407ab327158c510f44ded207e2f76b657303e17cb7a572ffe2f5a8a48aa04d", - "sha256:76e9c727a874b4856d11a32fb0b389afc61ce8aaf281ada613713ddeadd1cfec", - "sha256:77d4c1b881076c3ba173484dfa53d3582c1c8ff1f914c6461ab70c8428b796c1", - "sha256:780c82a41dc493b62fc5884fb1d3a3b81106642c5c5c78d6a0d4cbe96d62ba7e", - "sha256:7dc0713bf81287a00516ef43137273b23ee414fe41a3c14be10dd95ed98a2df9", - "sha256:7eebcdbe3677e58dd4c0e03b4f2cfa346ed4049687d839adad68cc38bb559c92", - "sha256:896689fddba4f23ef7c718279e42f8834041a21342d95e56922e1c10c0cc7afb", - "sha256:96177eb5645b1c6985f5c11d03fc2dbda9ad24ec0f3a46dcce91445747e15094", - "sha256:96e25c8603a155559231c19c0349245eeb4ac0096fe3c1d0be5c47e075bd4f46", - "sha256:9d37ac69edc5614b90516807de32d08cb8e7b12260a285ee330955604ed9dd29", - "sha256:9ed6aa0726b9b60911f4aed8ec5b8dd7bf3491476015819f56473ffaef8959bd", - "sha256:a487f72a25904e2b4bbc0817ce7a8de94363bd7e79890510174da9d901c38705", - "sha256:a4cbb9ff5795cd66f0066bdf5947f170f5d63a9274f99bdbca02fd973adcf2a8", - "sha256:a74d56552ddbde46c246b5b89199cb3fd182f9c346c784e1a93e4dc3f5ec9975", - "sha256:a89ce3fd220ff144bd9d54da333ec0de0399b52c9ac3d2ce34b569cf1a5748fb", - "sha256:abd52a09d03adf9c763d706df707c343293d5d106aea53483e0ec8d9e310ad5e", - "sha256:abd8f36c99512755b8456047b7be10372fca271bf1467a1caa88db991e7c421b", - "sha256:af5bd9ccb188f6a5fdda9f1f09d9f4c86cc8a539bd48a0bfdc97723970348418", - "sha256:b02f21c1e2074943312d03d243ac4388319f2456576b2c6023041c4d57cd7019", - "sha256:b06fa97478a5f478fb05e1980980a7cdf2712015493b44d0c87606c1513ed5b1", - "sha256:b0724f05c396b0a4c36a3226c31648385deb6a65d8992644c12a4963c70326ba", - "sha256:b130fe77361d6771ecf5a219d8e0817d61b236b7d8b37cc045172e574ed219e6", - "sha256:b56d5519e470d3f2fe4aa7585f0632b060d532d0696c5bdfb5e8319e1d0f69a2", - "sha256:b67b819628e3b748fd3c2192c15fb951f549d0f47c0449af0764d7647302fda3", - "sha256:ba1711cda2d30634a7e452fc79eabcadaffedf241ff206db2ee93dd2c89a60e7", - "sha256:bbeccb1aa40ab88cd29e6c7d8585582c99548f55f9b2581dfc5ba68c59a85752", - "sha256:bd84395aab8e4d36263cd1b9308cd504f6cf713b7d6d3ce25ea55670baec5416", - "sha256:c99f4309f5145b93eca6e35ac1a988f0dc0a7ccf9ccdcd78d3c0adf57224e62f", - "sha256:ca1cccf838cd28d5a0883b342474c630ac48cac5df0ee6eacc9c7290f76b11c1", - "sha256:cd525e0e52a5ff16653a3fc9e3dd827981917d34996600bbc34c05d048ca35cc", - "sha256:cdb4f085756c96a3af04e6eca7f08b1345e94b53af8921b25c72f096e704e145", - "sha256:ce42618f67741d4697684e501ef02f29e758a123aa2d669e2d964ff734ee00ee", - "sha256:d06730c6aed78cee4126234cf2d071e01b44b915e725a6cb439a879ec9754a3a", - "sha256:d5fe3e099cf07d0fb5a1e23d399e5d4d1ca3e6dfcbe5c8570ccff3e9208274f7", - "sha256:d6bcbfc99f55655c3d93feb7ef3800bd5bbe963a755687cbf1f490a71fb7794b", - "sha256:d787272ed958a05b2c86311d3a4135d3c2aeea4fc655705f074130aa57d71653", - "sha256:e169e957c33576f47e21864cf3fc9ff47c223a4ebca8960079b8bd36cb014fd0", - "sha256:e20076a211cd6f9b44a6be58f7eeafa7ab5720eb796975d0c03f05b47d89eb90", - "sha256:e826aadda3cae59295b95343db8f3d965fb31059da7de01ee8d1c40a60398b29", - "sha256:eef4d64c650f33347c1f9266fa5ae001440b232ad9b98f1f43dfe7a79435c0a6", - "sha256:f2e69b3ed24544b0d3dbe2c5c0ba5153ce50dcebb576fdc4696d52aa22db6034", - "sha256:f87ec75864c37c4c6cb908d282e1969e79763e0d9becdfe9fe5473b7bb1e5f09", - "sha256:fbec11614dba0424ca72f4e8ba3c420dba07b4a7c206c8c8e4e73f2e98f4c559", - "sha256:fd69666217b62fa5d7c6aa88e507493a34dec4fa20c5bd925e4bc12fce586639" - ], - "markers": "python_version >= '3.11'", - "version": "==1.15.0" - } - } -} diff --git a/back/api/models.py b/back/api/models.py deleted file mode 100644 index 88d584e0..00000000 --- a/back/api/models.py +++ /dev/null @@ -1,844 +0,0 @@ -import logging -import secrets -import uuid -from django.conf import settings -from django.core.validators import RegexValidator -from django.contrib.gis.db import models -from django.contrib.gis.geos import MultiPolygon, Polygon -from django.contrib.auth import get_user_model -from django.contrib.postgres.search import SearchVectorField -from django.contrib.postgres.indexes import GinIndex, BTreeIndex -from django.utils import timezone -from django.utils.html import mark_safe -from django.utils.translation import gettext_lazy as _ -from django.urls import reverse -from djmoney.money import Money -from djmoney.models.fields import MoneyField - -from .pricing import ProductPriceCalculator -from .helpers import RandomFileName, send_geoshop_email - -LOGGER = logging.getLogger(__name__) -# Get the UserModel -UserModel = get_user_model() - - -class AbstractIdentity(models.Model): - """ - Common properties for identities, addresses and temporary users - """ - first_name = models.CharField(_('first_name'), max_length=50, blank=True) - last_name = models.CharField(_('last_name'), max_length=150, blank=True) - email = models.EmailField(_('email'), max_length=254, blank=True) - street = models.CharField(_('street'), max_length=100, blank=True) - street2 = models.CharField(_('street2'), max_length=100, blank=True) - postcode = models.CharField(_('postcode'), max_length=10, blank=True) - city = models.CharField(_('city'), max_length=50, blank=True) - country = models.CharField(_('country'), max_length=50, blank=True) - company_name = models.CharField( - _('company_name'), max_length=250, blank=True) - phone = models.CharField(_('phone'), max_length=50, blank=True) - - class Meta: - abstract = True - - def __str__(self): - if self.company_name: - return '%s %s (%s)' % (self.last_name, self.first_name, self.company_name) - return '%s %s' % (self.last_name, self.first_name) - - -class Contact(AbstractIdentity): - """ - Address book of contacts linked to an user that stores addresses - previously filled by the user. - """ - belongs_to = models.ForeignKey( - UserModel, on_delete=models.CASCADE, verbose_name=_('belongs_to')) - sap_id = models.BigIntegerField(_('sap_id'), null=True, blank=True) - subscribed = models.BooleanField(_('subscribed'), default=False) - is_active = models.BooleanField(_('is_active'), default=True) - - class Meta: - db_table = 'contact' - verbose_name = _('contact') - - -class Copyright(models.Model): - description = models.TextField(blank=True) - - class Meta: - db_table = 'copyright' - verbose_name = _('copyright') - - def __str__(self): - return self.description - - -class Document(models.Model): - """ - Named links to more informations on metadata - """ - name = models.CharField(_('name'), max_length=80) - link = models.URLField( - _('link'), - help_text=_('Please complete the above URL'), - default='https://sitn.ne.ch', - max_length=2000 - ) - - class Meta: - db_table = 'document' - verbose_name = _('document') - - def __str__(self): - return '%s (%s)' % (self.name, self.link.split("/")[-1]) - - -class DataFormat(models.Model): - name = models.CharField(_('name'), max_length=100, blank=True) - - class Meta: - db_table = 'data_format' - verbose_name = _('data_format') - - def __str__(self): - return self.name - - -class OrderType(models.Model): - name = models.CharField(_('name'), max_length=30, blank=True) - - class Meta: - db_table = 'order_type' - verbose_name = _('order type') - verbose_name_plural = _('order types') - - def __str__(self): - return self.name - - -class Identity(AbstractIdentity): - """ - All users have an Identity but not all identities are users. - """ - user = models.OneToOneField( - UserModel, on_delete=models.SET_NULL, verbose_name=_('user'), blank=True, null=True) - sap_id = models.BigIntegerField(_('sap_id'), null=True, blank=True) - ide_id = models.CharField(_('ide_number'), max_length=15, null=True, blank=True, validators=[ - RegexValidator( - regex=r'^CHE-([0-9]{3}\.){2}[0-9]{3}$', - message=_('IDE number is not valid'), - ), - ]) - contract_accepted = models.DateField(_('contract_accepted'), null=True, blank=True) - is_public = models.BooleanField(_('is_public'), default=False) - subscribed = models.BooleanField(_('subscribed'), default=False) - birthday = models.DateField(_('birthday'), null=True, blank=True) - - class Meta: - db_table = 'identity' - verbose_name = _('identity') - - -class MetadataCategoryEch(models.Model): - """ - Imported list of eCH categories used to thematize metadatas - """ - - notation = models.CharField(_('notation'), max_length=3, unique=True) - description_fr = models.CharField(_('description_fr'), max_length=250) - - class Meta: - db_table = 'metadata_category_ech' - verbose_name = _('metadata_category_ech') - - def __str__(self): - return '%s (%s)' % (self.description_fr, self.notation) - - -class Metadata(models.Model): - """ - Describes one or more Products. Every metadata can have one or more contact persons - """ - - class MetadataAccessibility(models.TextChoices): - PUBLIC = 'PUBLIC', _('Public') - APPROVAL_NEEDED = 'APPROVAL_NEEDED', _('Approval needed') - NOT_ACCESSIBLE = 'NOT_ACCESSIBLE', _('Not accessible') - INTERNAL = 'INTERNAL', _('Internal') - - id_name = models.CharField(_('id_name'), max_length=100, unique=True) - name = models.CharField(_('name'), max_length=300, blank=True) - ech_category = models.ForeignKey( - MetadataCategoryEch, models.SET_NULL, verbose_name=_('ech_category'), null=True, blank=True) - description_long = models.TextField(_('description_long'), blank=True) - genealogy = models.TextField(_('genealogy'), blank=True) - datasource = models.CharField(_('datasource'), max_length=260, blank=True, null=True) - accessibility = models.CharField( - _('accessibility'), max_length=30, - choices=MetadataAccessibility.choices, - default=MetadataAccessibility.PUBLIC - ) - scale = models.CharField(_('scale'), max_length=50, blank=True) - geocat_link = models.CharField(_('geocat_link'), max_length=2000, blank=True) - legend_link = models.CharField(_('legend_link'), max_length=2000, blank=True) - image_link = models.CharField(_('image_link'), max_length=250, default=settings.DEFAULT_METADATA_IMAGE_URL, blank=True) - wms_link = models.CharField(_('wms_link'), max_length=2000, blank=True) - geoportal_link = models.CharField(_('geoportal_link'), max_length=2000, blank=True) - copyright = models.ForeignKey( - Copyright, models.SET_NULL, verbose_name=_('copyright'), blank=True, null=True) - documents = models.ManyToManyField(Document, verbose_name=_('documents'), blank=True) - contact_persons = models.ManyToManyField( - Identity, - verbose_name=_('contact_persons'), - related_name='contact_persons', - through='MetadataContact') - modified_date = models.DateTimeField(auto_now=True) - modified_user = models.ForeignKey( - UserModel, - models.PROTECT, - verbose_name=_('modified_user'), - related_name='modified_user') - data_last_update_date = models.DateField(_('data_last_update_date'), null=True, blank=True) - update_frequency = models.CharField(_('update_frequency'), max_length=50, blank=True) - - class Meta: - db_table = 'metadata' - verbose_name = _('metadata') - permissions = [ - ("view_internal", _('Can view metadata with accessibility set to "internal"')) - ] - - def __str__(self): - return self.id_name - - def get_legend_link(self): - if self.legend_link is None or self.legend_link == '': - return None - # When legend_link is 0, returns legend from mapserver - if self.legend_link == '0': - return settings.AUTO_LEGEND_URL + self.id_name - # When legend_link is intra, returns legend from intranet mapserver - if self.legend_link == 'intra': - return settings.INTRA_LEGEND_URL + self.id_name - if self.legend_link.startswith('http'): - return self.legend_link - return settings.MEDIA_URL + self.legend_link - - def legend_tag(self): - if self.get_legend_link(): - return mark_safe('' % self.get_legend_link()) - legend_tag.short_description = _('legend') - - def image_tag(self): - if self.image_link is None or self.image_link == '': - return mark_safe('' % (settings.MEDIA_URL, 'no_image.jpg')) - return mark_safe('' % (settings.MEDIA_URL, self.image_link)) - image_tag.short_description = _('image') - - -class MetadataContact(models.Model): - """ - Links Metadata with the persons to contact (Identity) depending on the role they play for metadata. - """ - metadata = models.ForeignKey(Metadata, models.CASCADE, verbose_name=_('metadata')) - contact_person = models.ForeignKey( - Identity, models.CASCADE, verbose_name=_('contact_person'), limit_choices_to={'is_public': True}) - metadata_role = models.CharField(_('role'), max_length=150, default='Gestionnaire') - is_validator = models.BooleanField(_('is_validator'), default=False) - - class Meta: - db_table = 'metadata_contact_persons' - verbose_name = _('metadata_contact') - - def __str__(self): - return '%s - %s (%s)' % (self.contact_person, self.metadata, self.metadata_role) - - -class Pricing(models.Model): - """ - Pricing for free products, single tax products or area priced products. - For free products, set base_fee and unit_price both to 0. - For unique price set base_fee to desired amount and unit_price to 0. - For price based on area, provide unit_price - For prices based on a PricingGeometry, create the pricing layer and - link it to pricing_layer field. - """ - class PricingType(models.TextChoices): - FREE = 'FREE', _('Free') - SINGLE = 'SINGLE', _('Single') - BY_NUMBER_OBJECTS = 'BY_NUMBER_OBJECTS', _('By number of objects') - BY_AREA = 'BY_AREA', _('By area') - FROM_PRICING_LAYER = 'FROM_PRICING_LAYER', _('From a pricing layer') - FROM_CHILDREN_OF_GROUP = 'FROM_CHILDREN_OF_GROUP', _('From children products of this group') - MANUAL = 'MANUAL', _('Manual') - - name = models.CharField(_('name'), max_length=100, null=True, blank=True) - pricing_type = models.CharField( - _('pricing_type'), max_length=30, choices=PricingType.choices) - base_fee = MoneyField( - _('base_fee'), max_digits=14, decimal_places=2, default_currency='CHF', null=True, blank=True) - min_price = MoneyField( - _('min_price'), max_digits=14, decimal_places=2, default_currency='CHF', null=True, blank=True) - max_price = MoneyField( - _('max_price'), max_digits=14, decimal_places=2, default_currency='CHF', null=True, blank=True) - unit_price = MoneyField( - _('unit_price'), max_digits=14, decimal_places=2, default_currency='CHF', null=True, blank=True) - - class Meta: - db_table = 'pricing' - verbose_name = _('pricing') - - def get_price(self, polygon): - """ - Returns the price of a product given a polygon - """ - price = ProductPriceCalculator.get_price( - pricing_instance=self, - polygon=polygon - ) - - if price is None: - return None, None - - if self.min_price and price < self.min_price: - return self.min_price, self.base_fee - - # if max_price is reached, will force customer ask for a quote - if self.max_price and price > self.max_price: - return None, None - - return price, self.base_fee - - def __str__(self): - return '%s + %s CHF de taxe' % (self.name, self.base_fee) - - -class PricingGeometry(models.Model): - """ - Areas defining prices must be grouped by name. - """ - name = models.CharField(_('name'), max_length=300, null=True) - unit_price = MoneyField( - _('price'), max_digits=14, decimal_places=2, default_currency='CHF', null=True) - geom = models.GeometryField(_('geom'), srid=settings.DEFAULT_SRID) - pricing = models.ForeignKey(Pricing, models.CASCADE, verbose_name=_('pricing'), null=True) - - class Meta: - db_table = 'pricing_layer' - verbose_name = _('pricing_layer') - indexes = (BTreeIndex(fields=('name',)),) - - def __str__(self): - return self.name - - -class Product(models.Model): - """ - A product is mostly a table or a raster. It can also be a group of products. - - Products with a PUBLISHED status are available in catalogue. - A product with a status PUBLISHED_ONLY_IN_GROUP cannot be found on - catalogue but can be ordered by the group he belongs to. - - Example: - PFP3_categorie_1 and PFP3_categorie_2 have a PUBLISHED_ONLY_IN_GROUP status: - they cannot be found as is in the catalogue, but they belong to another - product (with group_id property): PFP3 that has a PUBLISHED status. - """ - - class ProductStatus(models.TextChoices): - DRAFT = 'DRAFT', _('Draft') - PUBLISHED = 'PUBLISHED', _('Published') - PUBLISHED_ONLY_IN_GROUP = 'PUBLISHED_ONLY_IN_GROUP', _('Published only in group') - DEPRECATED = 'DEPRECATED', _('Deprecated') - - metadata = models.ForeignKey( - Metadata, - models.PROTECT, - verbose_name=_('metadata'), - limit_choices_to=models.Q(accessibility = Metadata.MetadataAccessibility.PUBLIC) | \ - models.Q(accessibility = Metadata.MetadataAccessibility.APPROVAL_NEEDED) - ) - label = models.CharField(_('label'), max_length=250, unique=True, validators=[ - RegexValidator( - regex=r'^[^<>%$"\(\)\n\r]*$', - message=_('Label contains forbidden characters'), - ), - ]) - status = models.CharField( - _('status'), max_length=30, choices=ProductStatus.choices, default=ProductStatus.DRAFT) - group = models.ForeignKey( - 'self', models.SET_NULL, verbose_name=_('group'), blank=True, null=True, related_name='products') - provider = models.ForeignKey( - UserModel, models.PROTECT, verbose_name=_('provider'), - limit_choices_to={ - 'groups__name': 'extract' - }) - pricing = models.ForeignKey(Pricing, models.PROTECT, verbose_name=_('pricing')) - free_when_subscribed = models.BooleanField(_('free_when_subscribed'), default=False) - order = models.BigIntegerField(_('order_index'), blank=True, null=True) - thumbnail_link = models.CharField( - _('thumbnail_link'), max_length=250, default=settings.DEFAULT_PRODUCT_THUMBNAIL_URL) - ts = SearchVectorField(null=True) - geom = models.MultiPolygonField(_('geom'), srid=settings.DEFAULT_SRID, default=MultiPolygon(Polygon.from_bbox( - (2519900, 1186430, 2578200, 1227030) - ))) - - class Meta: - db_table = 'product' - verbose_name = _('product') - ordering = ['order'] - # https://www.postgresql.org/docs/10/gin-intro.html - indexes = [GinIndex(fields=["ts"])] - - def __str__(self): - return self.label - - def thumbnail_tag(self): - if self.thumbnail_link is None or self.thumbnail_link == '': - return mark_safe('' % (settings.MEDIA_URL, 'no_image.jpg')) - return mark_safe('' % (settings.MEDIA_URL, self.thumbnail_link)) - thumbnail_tag.short_description = _('thumbnail') - - -class Order(models.Model): - """ - processing_fee should default to the maximum of base fees in the order but can then be edited mannually - """ - - class OrderStatus(models.TextChoices): - DRAFT = 'DRAFT', _('Draft') - PENDING = 'PENDING', _('Pending') - QUOTE_DONE = 'QUOTE_DONE', _('Quote done') - READY = 'READY', _('Ready') - IN_EXTRACT = 'IN_EXTRACT', _('In extract') - PARTIALLY_DELIVERED = 'PARTIALLY_DELIVERED', _('Partially delivered') - PROCESSED = 'PROCESSED', _('Processed') - ARCHIVED = 'ARCHIVED', _('Archived') - REJECTED = 'REJECTED', _('Rejected') - - title = models.CharField(_('title'), max_length=255, validators=[ - RegexValidator( - regex=r'^[^<>%$"\(\)\n\r]*$', - message=_('Title contains forbidden characters'), - ), - ]) - description = models.TextField(_('description'), blank=True) - processing_fee = MoneyField( - _('processing_fee'), max_digits=14, decimal_places=2, default_currency='CHF', blank=True, null=True) - total_without_vat = MoneyField( - _('total_without_vat'), max_digits=14, decimal_places=2, default_currency='CHF', blank=True, null=True) - part_vat = MoneyField( - _('part_vat'), max_digits=14, decimal_places=2, default_currency='CHF', blank=True, null=True) - total_with_vat = MoneyField( - _('total_with_vat'), max_digits=14, decimal_places=2, default_currency='CHF', blank=True, null=True) - geom = models.PolygonField(_('geom'), srid=settings.DEFAULT_SRID) - client = models.ForeignKey(UserModel, models.PROTECT, verbose_name=_('client'), blank=True) - invoice_contact = models.ForeignKey( - Contact, - models.PROTECT, - verbose_name=_('invoice_contact'), - related_name='invoice_contact', - blank=True, - null=True - ) - invoice_reference = models.CharField(_('invoice_reference'), max_length=255, blank=True) - email_deliver = models.EmailField(_('email_deliver'), max_length=254, blank=True, null=True) - order_type = models.ForeignKey(OrderType, models.PROTECT, verbose_name=_('order_type')) - status = models.CharField( - _('status'), max_length=20, choices=OrderStatus.choices, default=OrderStatus.DRAFT) - date_ordered = models.DateTimeField(_('date_ordered'), blank=True, null=True) - date_downloaded = models.DateTimeField(_('date_downloaded'), blank=True, null=True) - date_processed = models.DateTimeField(_('date_processed'), blank=True, null=True) - extract_result = models.FileField(upload_to='extract', null=True, blank=True) - download_guid = models.UUIDField(_('download_guid'), null=True, blank=True) - - class Meta: - db_table = 'order' - ordering = ['-date_ordered'] - verbose_name = _('order') - - def _reset_prices(self): - self.processing_fee = None - self.total_without_vat = None - self.part_vat = None - self.total_with_vat = None - - def ask_price(self): - send_geoshop_email( - _('Geoshop - Quote requested'), - template_name='email_admin', - template_data={ - 'messages': [_('A new quote has been requested:')], - 'details': { - _('order'): self.id, - _('link'): reverse("admin:api_order_change", args=[self.id]) - } - } - ) - - def set_price(self): - """ - Sets price information if all items have prices - """ - self._reset_prices() - items = self.items.all() - if items == []: - return False - self.total_without_vat = Money(0, 'CHF') - self.processing_fee = Money(0, 'CHF') - for item in items: - if item.base_fee is None: - self._reset_prices() - return False - if item.base_fee > self.processing_fee: - self.processing_fee = item.base_fee - self.total_without_vat += item.price - self.total_without_vat += self.processing_fee - self.part_vat = self.total_without_vat * settings.VAT - self.total_with_vat = self.total_without_vat + self.part_vat - return True - - def quote_done(self): - """Admins confirmation they have given a manual price""" - price_is_set = self.set_price() - if price_is_set: - self.status = self.OrderStatus.QUOTE_DONE - self.save() - send_geoshop_email( - _('Geoshop - Quote has been done'), - recipient=self.email_deliver or self.client.identity, - template_name='email_quote_done', - template_data={ - 'order_id': self.id, - 'first_name': self.client.identity.first_name, - 'last_name': self.client.identity.last_name - } - ) - return price_is_set - - def _flatten_groups(self, group_of_products: Product, data_format: DataFormat): - """ - Creates an OrderItem for each child found in an incoming group_of_products. - The new OrderItems will inherit chosen data_format for the group if possible. - """ - for child_product in group_of_products.products.all(): - # if child_product is a group, recurse - if child_product.products.exists(): - self._flatten_groups(child_product, data_format) - continue - - # only create OrderItem for products that intersect current order geom - if child_product.geom.intersects(self.geom): - new_item = OrderItem( - order=self, - product=child_product, - data_format=data_format - ) - # If the data format for the group is not available for the item, - # pick the first possible - LOGGER.debug(f'{child_product.label} wants format: {data_format}') - if new_item.data_format.name not in new_item.available_formats: - LOGGER.warning(f'{new_item.data_format} is not in {new_item.available_formats}') - new_item.data_format = child_product.product_formats.all().first().data_format - new_item.set_price() - new_item.save() - - def _expand_product_groups(self): - """ - When an OrderItem is a group of products, the OrderItem is deleted from cart and - is replaced with one OrderItem for each product inside the group by calling - _flatten_groups. - """ - items = self.items.all() - for item in items: - # if ordered product is a group (if product has children) - if item.product.products.exists(): - self._flatten_groups(item.product, item.data_format) - item.delete() - - def confirm(self): - """Customer's confirmations he wants to proceed with the order""" - self._expand_product_groups() - items = self.items.all() - self.date_ordered = timezone.now() - self.download_guid = uuid.uuid4() - has_all_prices_calculated = True - for item in items: - if item.price_status == OrderItem.PricingStatus.PENDING: - has_all_prices_calculated = has_all_prices_calculated and False - if item.product.metadata.accessibility == Metadata.MetadataAccessibility.APPROVAL_NEEDED: - item.ask_validation() - item.save() - if has_all_prices_calculated: - self.status = Order.OrderStatus.READY - else: - self.ask_price() - self.status = Order.OrderStatus.PENDING - - def next_status_on_extract_input(self): - """Controls status when Extract uploads a file or cancel an order item""" - previous_accepted_status = [ - Order.OrderStatus.READY, - Order.OrderStatus.IN_EXTRACT, - Order.OrderStatus.PARTIALLY_DELIVERED - ] - if self.status not in previous_accepted_status: - raise Exception("Order has an inappropriate status after input") - items_statuses = set(self.items.all().values_list('status', flat=True)) - - if OrderItem.OrderItemStatus.IN_EXTRACT in items_statuses or OrderItem.OrderItemStatus.PENDING in items_statuses: - if OrderItem.OrderItemStatus.PROCESSED in items_statuses: - self.status = Order.OrderStatus.PARTIALLY_DELIVERED - else: - self.status = Order.OrderStatus.READY - else: - if OrderItem.OrderItemStatus.PROCESSED in items_statuses: - if OrderItem.OrderItemStatus.VALIDATION_PENDING in items_statuses: - self.status = Order.OrderStatus.PARTIALLY_DELIVERED - else: - self.status = Order.OrderStatus.PROCESSED - self.date_processed = timezone.now() - send_geoshop_email( - _('Geoshop - Download ready'), - recipient=self.email_deliver or self.client.identity, - template_name='email_download_ready', - template_data={ - 'order_id': self.id, - 'download_guid': self.download_guid, - 'front_url': '{}://{}{}'.format( - settings.FRONT_PROTOCOL, - settings.FRONT_URL, - settings.FRONT_HREF - ), - 'first_name': self.client.identity.first_name, - 'last_name': self.client.identity.last_name, - } - ) - else: - self.status = Order.OrderStatus.REJECTED - return self.status - - @property - def geom_srid(self): - return self.geom.srid - - @property - def geom_area(self): - return self.geom.area - - def __str__(self): - return '%s - %s' % (self.id, self.title) - - -class OrderItem(models.Model): - """ - Cart item. - """ - - class PricingStatus(models.TextChoices): - PENDING = 'PENDING', _('Pending') - CALCULATED = 'CALCULATED', _('Calculated') - IMPORTED = 'IMPORTED', _('Imported') # from old database - - class OrderItemStatus(models.TextChoices): - VALIDATION_PENDING = 'VALIDATION_PENDING', _('Validation pending') - PENDING = 'PENDING', _('Pending') - IN_EXTRACT = 'IN_EXTRACT', _('In extract') - PROCESSED = 'PROCESSED', _('Processed') - ARCHIVED = 'ARCHIVED', _('Archived') - REJECTED = 'REJECTED', _('Rejected') - - order = models.ForeignKey( - Order, models.CASCADE, related_name='items', verbose_name=_('order'), blank=True, null=True) - product = models.ForeignKey( - Product, models.PROTECT, verbose_name=_('product'), blank=True, null=True) - data_format = models.ForeignKey( - DataFormat, models.PROTECT, verbose_name=_('data_format'), blank=True, null=True) - srid = models.IntegerField(_('srid'), default=settings.DEFAULT_SRID) - last_download = models.DateTimeField(_('last_download'), blank=True, null=True) - validation_date = models.DateTimeField(_('validation_date'), blank=True, null=True) - price_status = models.CharField( - _('price_status'), max_length=20, choices=PricingStatus.choices, default=PricingStatus.PENDING) - status = models.CharField( - _('status'), max_length=20, choices=OrderItemStatus.choices, default=OrderItemStatus.PENDING) - _price = MoneyField( - _('price'), max_digits=14, decimal_places=2, default_currency='CHF', null=True, blank=True) - _base_fee = MoneyField( - _('base_fee'), max_digits=14, decimal_places=2, default_currency='CHF', null=True, blank=True) - extract_result = models.FileField(upload_to=RandomFileName('extract'), null=True, blank=True) - comment = models.TextField(_('comment'), null=True, blank=True) - token = models.CharField(_('token'), max_length=256, null=True, blank=True) - - - class Meta: - db_table = 'order_item' - verbose_name = _('order_item') - - @property - def available_formats(self): - queryset = ProductFormat.objects.filter( - product=self.product).values_list('data_format__name', flat=True) - return list(queryset) - - def _get_price_values(self, price_value): - if self.price_status == OrderItem.PricingStatus.PENDING: - LOGGER.info("You are trying to get a pricing value but pricing status is still PENDING") - return None - return price_value - - @property - def price(self): - return self._get_price_values(self._price) - - @property - def base_fee(self): - return self._get_price_values(self._base_fee) - - def _calculate_nested_price(self, group_of_products: Product): - """ - Sums all levels of nested prices inside a group of products - to _self_price and sets _base_fee for the group - """ - for product in group_of_products.products.all(): - if product.products.exists(): - self._calculate_nested_price(product) - continue - if product.geom.intersects(self.order.geom): - price, base_fee = product.pricing.get_price(self.order.geom) - if price: - self._price += price - if base_fee and base_fee > self._base_fee: - self._base_fee = base_fee - - def set_price(self, price=None, base_fee=None): - """ - Sets price and updates price status - """ - self._price = None - self._base_fee = None - self.price_status = OrderItem.PricingStatus.PENDING - - # prices are 0 when user or invoice_contact is subscribed to the product - if self.order.order_type.name == 'Utilisateur permanent': - if self.product.free_when_subscribed: - if self.order.client.identity.subscribed or ( - self.order.invoice_contact is not None and self.order.invoice_contact.subscribed): - self._price = Money(0, 'CHF') - self._base_fee = Money(0, 'CHF') - self.price_status = OrderItem.PricingStatus.CALCULATED - return - # if user or contact is not subscribed, quote needs to be done - self.price_status = OrderItem.PricingStatus.PENDING - return - - # prices are 0 when order is for public authorities or academic purposes - if self.order.order_type.name in ('Communal', 'Cantonal', 'Fédéral', 'Académique'): - self._price = Money(0, 'CHF') - self._base_fee = Money(0, 'CHF') - self.price_status = OrderItem.PricingStatus.CALCULATED - return - - if self.product.pricing.pricing_type != Pricing.PricingType.MANUAL: - if self.product.pricing.pricing_type == Pricing.PricingType.FROM_CHILDREN_OF_GROUP: - # Pricing from children is only used when groups are present in cart - # When order is confirmed groups are falttenend and - # each price will be set individually - self._price = Money(0, 'CHF') - self._base_fee = Money(0, 'CHF') - self._calculate_nested_price(self.product) - else: - self._price, self._base_fee = self.product.pricing.get_price(self.order.geom) - if self._price is not None: - self.price_status = OrderItem.PricingStatus.CALCULATED - return - # When price is MANUAL and a price is passed as argument of this function - else: - if price is not None: - self._price = price - self._base_fee = base_fee - self.price_status = OrderItem.PricingStatus.CALCULATED - return - self.price_status = OrderItem.PricingStatus.PENDING - return - - def ask_validation(self): - """ - Sends email to the first metadata contact that is validator to ask for validation. - If validator cannot be found, an email to one of the metadata contact is sent. - """ - self.token = secrets.token_urlsafe(32) - self.status = OrderItem.OrderItemStatus.VALIDATION_PENDING - validator = MetadataContact.objects.filter(metadata=self.product.metadata).order_by('-is_validator').first() - send_geoshop_email( - _('Geoshop - Validation requested'), - recipient=validator.contact_person, - template_name='email_validation_needed', - template_data={ - 'front_url': '{}://{}{}'.format( - settings.FRONT_PROTOCOL, - settings.FRONT_URL, - settings.FRONT_HREF - ), - 'what': 'orderitem', - 'token': self.token, - } - ) - - -class ProductField(models.Model): - """ - Describes fields and their types of products. - """ - - class ProductFieldType(models.TextChoices): - REAL = 'REAL', 'Real' - DATE = 'DATE', 'Date' - CHAR = 'CHAR', 'Character' - VARCHAR = 'VARCHAR', 'Varying character' - INT = 'INT', 'Integer' - BIGINT = 'BIGINT', 'Big integer' - FLOAT = 'FLOAT', 'Floating number' - - db_name = models.CharField(_('db_name'), max_length=50, blank=True) - export_name = models.CharField(_('export_name'), max_length=50, blank=True) - field_type = models.CharField( - _('field_type'), max_length=10, choices=ProductFieldType.choices, blank=True) - field_length = models.SmallIntegerField(_('field_length'), ) - product = models.ForeignKey(Product, verbose_name=_('product'), on_delete=models.CASCADE) - - class Meta: - db_table = 'product_field' - verbose_name = _('product_field') - - -class ProductFormat(models.Model): - product = models.ForeignKey( - Product, models.CASCADE, verbose_name=_('product'), related_name='product_formats') - data_format = models.ForeignKey(DataFormat, models.CASCADE, verbose_name=_('data_format')) - # extraction manuelle ou automatique - is_manual = models.BooleanField(_('is_manual'), default=False) - - class Meta: - db_table = 'product_format' - unique_together = (('product', 'data_format'),) - verbose_name = _('product_format') - - -class UserChange(AbstractIdentity): - """ - Stores temporary data in order to proceed user profile change requests. - """ - client = models.ForeignKey(UserModel, models.CASCADE, verbose_name=_('client')) - ide_id = models.CharField(_('ide_number'), max_length=15, null=True, blank=True, validators=[ - RegexValidator( - regex=r'^CHE-([0-9]{3}\.){2}[0-9]{3}$', - message=_('IDE number is not valid'), - ), - ]) - - class Meta: - db_table = 'user_change' - verbose_name = _('user_change') diff --git a/back/api/templates/gis/admin/sitn.html b/back/api/templates/gis/admin/sitn.html deleted file mode 100644 index c132df95..00000000 --- a/back/api/templates/gis/admin/sitn.html +++ /dev/null @@ -1,2 +0,0 @@ -{% extends "gis/admin/openlayers.html" %} -{% block openlayers %}{% include "gis/admin/sitn.js" %}{% endblock %} \ No newline at end of file diff --git a/back/api/templates/gis/admin/sitn.js b/back/api/templates/gis/admin/sitn.js deleted file mode 100644 index bb75c6cb..00000000 --- a/back/api/templates/gis/admin/sitn.js +++ /dev/null @@ -1,21 +0,0 @@ -{% extends "gis/admin/openlayers.js" %} -{% block map_options %} -var options = { - projection: new OpenLayers.Projection('EPSG:2056'), - resolutions: [250, 100, 50, 20, 10, 5, 2.5, 2, 1.5, 1, 0.5, 0.25, 0.125, 0.0625], - units: 'm', - maxExtent: new OpenLayers.Bounds(2420000.0, 1030000.0, 2900000.0, 1360000.0), - tileSize: new OpenLayers.Size(256, 256) -}; -{% endblock %} -{% block base_layer %}new OpenLayers.Layer.WMTS({ - name: "WMTS plan_cadastral", - url: "https://sitn.ne.ch/mapproxy95/wmts/1.0.0/plan_cadastral/default/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png", - layer: 'plan_cadastral', - matrixSet: 'EPSG2056', - format: 'png', - isBaseLayer: true, - style: 'default', - requestEncoding: 'REST' -}); -{% endblock %} \ No newline at end of file diff --git a/back/asgi.py b/back/asgi.py deleted file mode 100644 index 105edb12..00000000 --- a/back/asgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -ASGI config for geoshop_backend project. - -It exposes the ASGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/ -""" - -import os - -from django.core.asgi import get_asgi_application - -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'geoshop_backend.settings') - -application = get_asgi_application() diff --git a/back/settings.py b/default_settings.py similarity index 95% rename from back/settings.py rename to default_settings.py index 659ac1ec..6c6be802 100644 --- a/back/settings.py +++ b/default_settings.py @@ -1,16 +1,7 @@ -""" -Django settings for geoshop_backend project. - -Generated by 'django-admin startproject' using Django 3.0.3. - -For more information on this file, see -https://docs.djangoproject.com/en/3.0/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/3.0/ref/settings/ -""" - import os +from dotenv import load_dotenv + +load_dotenv() # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/back/static/.gitkeep b/files/.gitkeep similarity index 100% rename from back/static/.gitkeep rename to files/.gitkeep diff --git a/back/manage.py b/manage.py similarity index 96% rename from back/manage.py rename to manage.py index b1846261..190c6dd9 100644 --- a/back/manage.py +++ b/manage.py @@ -1,21 +1,21 @@ -#!/usr/bin/env python -"""Django's command-line utility for administrative tasks.""" -import os -import sys - - -def main(): - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings') - try: - from django.core.management import execute_from_command_line - except ImportError as exc: - raise ImportError( - "Couldn't import Django. Are you sure it's installed and " - "available on your PYTHONPATH environment variable? Did you " - "forget to activate a virtual environment?" - ) from exc - execute_from_command_line(sys.argv) - - -if __name__ == '__main__': - main() +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/back/requirements.txt b/requirements.txt similarity index 100% rename from back/requirements.txt rename to requirements.txt diff --git a/static/.gitkeep b/static/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/back/urls.py b/urls.py similarity index 100% rename from back/urls.py rename to urls.py diff --git a/back/wsgi.py b/wsgi.py similarity index 96% rename from back/wsgi.py rename to wsgi.py index 2348c3fe..8341be59 100644 --- a/back/wsgi.py +++ b/wsgi.py @@ -1,21 +1,21 @@ -""" -WSGI config for geoshop_backend project. - -It exposes the WSGI callable as a module-level variable named ``application``. - -For more information on this file, see -https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ -""" - -import os -from whitenoise import WhiteNoise -from django.core.wsgi import get_wsgi_application - -PATH = os.path.join(os.path.dirname(os.path.abspath(__file__))) - -env_path = os.path.join(PATH, ".env") - -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings') - -application = get_wsgi_application() -application = WhiteNoise(application, root=os.path.join(PATH, "static")) +""" +WSGI config for geoshop_backend project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/ +""" + +import os +from whitenoise import WhiteNoise +from django.core.wsgi import get_wsgi_application + +PATH = os.path.join(os.path.dirname(os.path.abspath(__file__))) + +env_path = os.path.join(PATH, ".env") + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings') + +application = get_wsgi_application() +application = WhiteNoise(application, root=os.path.join(PATH, "static"))