Update case study display

This commit is contained in:
2018-12-02 00:31:26 +00:00
parent 5c7d4005f0
commit 23c1279f61
2 changed files with 136 additions and 119 deletions

View File

@ -1115,30 +1115,6 @@ class CaseStudy(models.Model):
"""Gets the 11 number video ID from the video field."""
return parse.urlparse(self.video).path
def get_negative_case_reasons_no_other(self):
"""Return a list of negative case reasons, minus the 'other' choice (if selected)"""
choices = self.get_negative_case_reasons_list()
return choices
def get_renewable_generation_detail(self):
"""Prepend appropriate descriptive text when accessing renewable generation type."""
if self.generation_technology:
if self.generation_technology.endswith('WE'):
return _('Wind energy') + " " + self.get_generation_technology_display()
elif self.generation_technology.endswith('PV'):
return _('Photovoltaic electricity') + " " + self.get_generation_technology_display()
elif self.generation_technology.endswith('HYD'):
return _('Hydroelectric') + " " + self.get_generation_technology_display()
elif self.generation_technology == 'OTHR':
return self.generation_technology_other
else:
return self.get_generation_technology_display()
else:
return ""
class Meta:
verbose_name_plural = 'case studies'