Replace django-moderation with CaseStudy.visible

This commit is contained in:
Carl van Tonder
2018-03-27 00:14:01 -04:00
parent 9a98520cca
commit 63a52a1f7f
8 changed files with 63 additions and 23 deletions

View File

@ -16,9 +16,18 @@ class Shapefile(models.Model):
)
class CaseStudyQuerySet(models.QuerySet):
def approved(self):
return self.filter(
approved=True
)
class CaseStudy(models.Model):
"""Model for case studies submitted to the Ojuso Platform"""
approved = models.BooleanField(default=False)
# Choice lists for drop-downs
SECTOR_CHOICES = (
(_('Renewable Energy Generation'), (
@ -965,6 +974,8 @@ class CaseStudy(models.Model):
blank=True
)
objects = CaseStudyQuerySet.as_manager()
def __str__(self):
"""The String representation of the case study. (Entry name with country name.)"""
return "%s in %s" % (self.entry_name, self.country.name)