Implement Tom's emailed suggestions

This commit is contained in:
2018-11-26 22:34:06 +00:00
parent aac22da18c
commit 04b8ae7bf9
3 changed files with 133 additions and 118 deletions

View File

@ -53,13 +53,6 @@ class CaseStudy(models.Model):
approved = models.BooleanField(default=False)
# Choice lists for drop-downs
SECTOR_CHOICES = (
('RN', _('Renewable energy generation project')),
('PG', _('Energy networks and energy storage facilities')),
('SM', _('Mining related to the renewable energy economy')),
('MA', _('Manufacturing and/or processing of equipment'))
)
POSITIVE_NEGATIVE_CHOICES = (
('P', _('There is/was an organising process in favour of the project')),
('N', _('There is/was an organising process against the project')),
@ -139,6 +132,14 @@ class CaseStudy(models.Model):
('WB', _('World Bank')),
)
SECTOR_CHOICES = (
('RN', _('Renewable energy generation project')),
('PG', _('Energy networks')),
('ST', _('Energy storage facilities')),
('SM', _('Mining related to the renewable energy economy')),
('MA', _('Manufacturing and/or processing of equipment'))
)
GENERATION_TYPE_CHOICES = (
('POW', _('Power')),
('HOT', _('Heat/Cool')),
@ -177,7 +178,6 @@ class CaseStudy(models.Model):
POWER_TECHNOLOGY_CHOICES = (
('PT', _('Electrical power transmission')),
('ES', _('Energy storage')),
('HN', _('Heat networks')),
('OT', _('Other')),
)
@ -275,11 +275,8 @@ class CaseStudy(models.Model):
('EACP', _('Community project owned by not-for-profit organizations and/or serving the public interest')),
('PSEP', _('Public/state (federal, state, municipal) project')),
('CORS', _('Reuse / Recycling / Circular economy project')),
('OTHR', _('Other(s)'))
)
NEGATIVE_CASE_REASONS_OTHER_TEXT = _('Other reasons')
NEGATIVE_CASE_REASONS_CHOICES = (
('VOLR', _('Violation of land rights')),
('VOHR', _('Violation of fundamental human rights, indigenous rights and/or other collective rights')),
@ -291,14 +288,6 @@ class CaseStudy(models.Model):
etc')),
('ALAB', _('Abusive labour practices')),
('CRUP', _('Corruption and/or irregular permitting or contracting, conflicts of interest etc')),
#
# N.B.
# If you add another field in here, you need to edit conditionalCheckboxes
# in templates/map/form.html and increment the check for the 'other' field there.
# If you don't, the 'other' detail entry won't show and hide at the appropriate
# times.
#
('OTHR', NEGATIVE_CASE_REASONS_OTHER_TEXT)
)
# Dynamically generate a list of choices 40 years prior and after the current year.
@ -378,13 +367,6 @@ class CaseStudy(models.Model):
max_length=128
)
# 1.2
sector_of_economy = models.CharField(
verbose_name=_("Sector of economy"),
max_length=3,
choices=SECTOR_CHOICES
)
# 1.4
country = CountryField(
verbose_name=_("Country"),
@ -447,7 +429,7 @@ class CaseStudy(models.Model):
blank=True
)
# XXX Delete after migration
# XXX Delete after migration - merge into affected_communities
people_affected_indigenous = models.TextField(
verbose_name=_("Indigenous people affected"),
help_text=_("What group or groups of indigenous people are affected by this project? \
@ -455,11 +437,10 @@ class CaseStudy(models.Model):
blank=True
)
# XXX Delete after migration
people_affected_other = models.TextField(
verbose_name=_("Non-indigenous people affected"),
help_text=_("What other group or groups of people are affected by this project? \
Please separate by newline."),
verbose_name=_("Communities or identities further detail"),
help_text=_("Please describe further the communities or identities present \
in the project area."),
blank=True
)
@ -548,16 +529,6 @@ class CaseStudy(models.Model):
blank=True
)
# 1.14
energy_customers = models.TextField(
verbose_name=_("Energy service consumers/off-takers"),
help_text=_("List any energy customers/off-takers that take energy from the \
development. E.g. 'national grids' or private energy suppliers. \
Also refer to if carbon markets, credits, blockchain etc. are \
involved in the process. Please separate with a new line."),
blank=True
)
# 1.15.1, 1.15.2, 1.15.3
images = models.ManyToManyField(
'files.ImageFile',
@ -632,6 +603,19 @@ class CaseStudy(models.Model):
# Second Screen - Technical and economic analysis
##
sector_of_economy = models.CharField(
verbose_name=_("Sector of economy"),
max_length=3,
choices=SECTOR_CHOICES
)
energy_details = models.CharField(
verbose_name=_("Further details"),
help_text=_("Please give more information about the transmission, network or storage technology."),
max_length=200,
blank=True
)
## Energy generation project
generation_type = models.CharField(
@ -649,15 +633,6 @@ class CaseStudy(models.Model):
blank=True
)
generation_technology_other = models.CharField(
verbose_name=_("Further details"),
help_text=_("If you selected other, or if you would like to further define what you have chosen, \
please specify the generation technology further. For example, if you chose solar PV \
it is most likely to be a crystalline silicon type, but maybe it is not."),
max_length=200,
blank=True
)
# Should be filled in if generation_technology was answered as bio-energy
biomass_detail = models.CharField(
verbose_name=_("Bio-energy feedstock"),
@ -679,6 +654,16 @@ class CaseStudy(models.Model):
blank=True
)
# 1.14
energy_customers = models.TextField(
verbose_name=_("Energy service consumers/off-takers"),
help_text=_("List any energy customers/off-takers that take energy from the \
development. E.g. 'national grids' or private energy suppliers. \
Also refer to if carbon markets, credits, blockchain etc. are \
involved in the process. Please separate with a new line."),
blank=True
)
# 2.1.2
total_generation_capacity = models.PositiveIntegerField(
verbose_name=_("Total generation capacity (in kW)"),
@ -687,8 +672,7 @@ class CaseStudy(models.Model):
null=True
)
# 2.1.3
# TODO: Auto-completion based on previous entries so we can query case-studies with the same answer.
# XXX Delete after migration - merge into contractor_or_supplier_of_technology
generation_equipment_supplier = models.TextField(
verbose_name=_("Generation equipment supplier(s)"),
help_text=_("Enter the supplier of the generation equipment. (E.g. Siemens Gamesa, GE, Alstom, Vestas, Hanwha Q CELLS, Mitsubishi, First Solar, Jinko Solar, Trina Solar, Suzlon Energy, Statkraft, Shanghai Electric, Ballard Power Systems, Panasonic, etc.)"),
@ -698,12 +682,12 @@ class CaseStudy(models.Model):
# 2.1.4
total_investment = models.IntegerField(
verbose_name=_("Total investment (in USD)"),
help_text=_("The approximate total investment for the project in USD."),
help_text=_("The approximate total investment for the project in US dollars."),
blank=True,
null=True
)
# 2.1.5
# XXX Delete after migration - merge into additional_technical_details
technical_or_economic_details = models.TextField(
verbose_name=_("Additional technical or economic details"),
help_text=_("Specify any additional technical or economic details relating to the project."),
@ -742,7 +726,7 @@ class CaseStudy(models.Model):
null=True,
)
# XXX Delete after migration
# XXX Delete after migration - no merge
maximum_power_output = models.DecimalField(
verbose_name=_('Maximum power output'),
help_text=_('Enter the maximum power output of the storage system in kilowatts (kW).'),
@ -752,7 +736,7 @@ class CaseStudy(models.Model):
null=True,
)
# XXX Delete after migration
# XXX Delete after migration - no merge
discharge_time = models.DecimalField(
verbose_name=_('Time for discharge from full capacity'),
help_text=_('Enter the time it takes to discharge from full capacity at maximum power output (in hours).'),
@ -762,15 +746,14 @@ class CaseStudy(models.Model):
null=True
)
# 2.2.3
contractor_or_supplier_of_technology = models.CharField(
# TODO: Auto-completion based on previous entries so we can query case-studies with the same answer.
contractor_or_supplier_of_technology = models.TextField(
verbose_name=_('Contractor and/or supplier of technology'),
help_text=_('List companies that act as contractors or suppliers  e.g. Siemens Gamesa, GE, Alstom, Vestas, Hanwha Q CELLS, Mitsubishi, First Solar, Jinko Solar, Trina Solar, Suzlon Energy, Statkraft, Shanghai Electric, Ballard Power Systems, Panasonic, etc'),
max_length=256,
blank=True,
)
# 2.2.4
# XXX Delete after migration - merge into total_investment
approximate_total_investment = models.PositiveIntegerField(
verbose_name=_('Approximate total investment'),
help_text=_('Enter the approximate total investment in USD ($).'),
@ -910,11 +893,10 @@ class CaseStudy(models.Model):
choices=POSITIVE_NEGATIVE_CHOICES
)
positive_case_type = models.CharField(
positive_case_type = MultiSelectField(
verbose_name=_('What kind of case is this entry about?'),
help_text=_('Select the most relevant type of positive case'),
choices=POSITIVE_CASE_TYPE_CHOICES,
max_length=4,
max_length=32,
blank=True,
)
@ -1007,6 +989,15 @@ class CaseStudy(models.Model):
blank=True
)
# XXX delete after migration - merge with identified_partnerships
potential_partnerships = models.CharField(
verbose_name=_("Describe potential partnerships"),
help_text=_("Are you looking for partnerships or do you have any clearly identified need? If so, please \
describe it here."),
max_length=512,
blank=True
)
# 3.2.7
wants_conversation_with_ojuso = models.BooleanField(
verbose_name=_("Would you like to have a conversation with the ojuso team?"),
@ -1127,9 +1118,6 @@ class CaseStudy(models.Model):
"""Return a list of negative case reasons, minus the 'other' choice (if selected)"""
choices = self.get_negative_case_reasons_list()
if choices.count(self.NEGATIVE_CASE_REASONS_OTHER_TEXT) > 0:
choices.remove(self.NEGATIVE_CASE_REASONS_OTHER_TEXT)
return choices
def get_renewable_generation_detail(self):