From b2266600de02c06bb37823361102455608498f65 Mon Sep 17 00:00:00 2001 From: Anna Sidwell Date: Sat, 31 Mar 2018 20:52:06 +1100 Subject: [PATCH] Add banks list. Closes #23. --- apps/map/forms.py | 1 + .../map/migrations/0048_auto_20180331_0933.py | 27 ++++++++++ apps/map/models.py | 49 ++++++++++++++++--- 3 files changed, 70 insertions(+), 7 deletions(-) create mode 100644 apps/map/migrations/0048_auto_20180331_0933.py diff --git a/apps/map/forms.py b/apps/map/forms.py index 765601e..36c50df 100644 --- a/apps/map/forms.py +++ b/apps/map/forms.py @@ -94,6 +94,7 @@ class LongCaseStudyForm(BaseCaseStudyForm): 'project_owners', 'shareholders', 'financial_institutions', + 'financial_institutions_other', 'energy_customers', 'image', 'image_caption', diff --git a/apps/map/migrations/0048_auto_20180331_0933.py b/apps/map/migrations/0048_auto_20180331_0933.py new file mode 100644 index 0000000..a660c3e --- /dev/null +++ b/apps/map/migrations/0048_auto_20180331_0933.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.6 on 2018-03-31 09:33 +from __future__ import unicode_literals + +from django.db import migrations, models +import multiselectfield.db.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('map', '0047_auto_20180331_0607'), + ] + + operations = [ + migrations.AddField( + model_name='casestudy', + name='financial_institutions_other', + field=models.TextField(blank=True, help_text='List any other financial institutions not listed above. Put each on a new line.', verbose_name='Financial institutions – other'), + ), + migrations.AlterField( + model_name='casestudy', + name='financial_institutions', + field=multiselectfield.db.fields.MultiSelectField(blank=True, choices=[('AfDB', 'African Development Bank (AfDB)'), ('BADEA', 'Arab Bank for Economic Development in Africa (BADEA)'), ('ADB', 'Asian Development Bank (ADB)'), ('AIIB', 'Asian Infrastructure Investment Bank (AIIB)'), ('BSTDB', 'Black Sea Trade and Development Bank (BSTDB)'), ('CAF', 'Corporacion Andina de Fomento / Development Bank of Latin America (CAF)'), ('CDB', 'Caribbean Development Bank (CDB)'), ('CABEI', 'Central American Bank for Economic Integration (CABEI)'), ('EADB', 'East African Development Bank (EADB)'), ('ETDB', 'Economic Cooperation Organization Trade and Development Bank (ETDB)'), ('EDB', 'Eurasian Development Bank (EDB)'), ('EBRD', 'European Bank for Reconstruction and Development (EBRD)'), ('EC', 'European Commission (EC)'), ('EIB', 'European Investment Bank (EIB)'), ('IADB', 'Inter-American Development Bank Group (IDB, IADB)'), ('IFFIm', 'International Finance Facility for Immunisation (IFFIm)'), ('IFAD', 'International Fund for Agricultural Development (IFAD)'), ('IIB', 'International Investment Bank (IIB)'), ('IsDB', 'Islamic Development Bank (IsDB)'), ('FMO', 'Nederlandse Financieringsmaatschappij voor Ontwikkelingslanden NV (FMO)'), ('NDB', 'New Development Bank (NDB) (formerly BRICS Development Bank)'), ('NDF', 'The Nordic Development Fund'), ('NIB', 'Nordic Investment Bank (NIB)'), ('OFID', 'OPEC Fund for International Development (OFID)'), ('BOAD', 'West African Development Bank (BOAD)'), ('WB', 'World Bank')], default='', help_text='Select any financial institutions that have or are considering extending loans or guarantees to the project.', max_length=119, verbose_name='Financial institutions'), + preserve_default=False, + ), + ] diff --git a/apps/map/models.py b/apps/map/models.py index 1f3b677..e9e54fb 100644 --- a/apps/map/models.py +++ b/apps/map/models.py @@ -72,6 +72,35 @@ class CaseStudy(models.Model): ('PROJCD', _('Projected Project')), ) + FINANCIAL_INSTITUTIONS = ( + ('AfDB', _('African Development Bank (AfDB)')), + ('BADEA', _('Arab Bank for Economic Development in Africa (BADEA)')), + ('ADB', _('Asian Development Bank (ADB)')), + ('AIIB', _('Asian Infrastructure Investment Bank (AIIB)')), + ('BSTDB', _('Black Sea Trade and Development Bank (BSTDB)')), + ('CAF', _('Corporacion Andina de Fomento / Development Bank of Latin America (CAF)')), + ('CDB', _('Caribbean Development Bank (CDB)')), + ('CABEI', _('Central American Bank for Economic Integration (CABEI)')), + ('EADB', _('East African Development Bank (EADB)')), + ('ETDB', _('Economic Cooperation Organization Trade and Development Bank (ETDB)')), + ('EDB', _('Eurasian Development Bank (EDB)')), + ('EBRD', _('European Bank for Reconstruction and Development (EBRD)')), + ('EC', _('European Commission (EC)')), + ('EIB', _('European Investment Bank (EIB)')), + ('IADB', _('Inter-American Development Bank Group (IDB, IADB)')), + ('IFFIm', _('International Finance Facility for Immunisation (IFFIm)')), + ('IFAD', _('International Fund for Agricultural Development (IFAD)')), + ('IIB', _('International Investment Bank (IIB)')), + ('IsDB', _('Islamic Development Bank (IsDB)')), + ('FMO', _('Nederlandse Financieringsmaatschappij voor Ontwikkelingslanden NV (FMO)')), + ('NDB', _('New Development Bank (NDB) (formerly BRICS Development Bank)')), + ('NDF', _('The Nordic Development Fund')), + ('NIB', _('Nordic Investment Bank (NIB)')), + ('OFID', _('OPEC Fund for International Development (OFID)')), + ('BOAD', _('West African Development Bank (BOAD)')), + ('WB', _('World Bank')), + ) + GENERATION_TECHNOLOGY_CHOICES = ( (_('Wind energy'), ( ('SSWE', _('Small-scale (less than 500kW)')), @@ -374,14 +403,20 @@ class CaseStudy(models.Model): blank=True ) - # 1.13 - financial_institutions = models.CharField( + # 1.13.1 + financial_institutions = MultiSelectField( verbose_name=_("Financial institutions"), - help_text=_("List banks and other financial institutions that have or are considering extending loans \ - or guarantees to the project. Separate with a comma."), - max_length=120, - default=None, - null=True, + help_text=_("Select any financial institutions that have or are considering extending \ + loans or guarantees to the project."), + choices=FINANCIAL_INSTITUTIONS, + blank=True + ) + + # 1.13.2 + financial_institutions_other = models.TextField( + verbose_name=_("Financial institutions – other"), + help_text=_("List any other financial institutions not listed above. \ + Put each on a new line."), blank=True )