old_contents: from datetime import timedelta
  
  from django.core.exceptions import ValidationError
  from django.db import models
  from django.utils import timezone
  from django.utils.translation import ugettext as _
  
  from adhocracy4.modules import models as modules_models
  
  from . import content
  from .validators import validate_content
  
  
  class PhasesQuerySet(models.QuerySet):
  
      def active_phases(self):
          now = timezone.now()
          return self.filter(start_date__lte=now, end_date__gt=now)
  
      def finished_phases(self):
          return self.filter(end_date__lte=timezone.now())
  
      def finish_next(self):
          """
          All phases that are active and finish within 24 hours.
          """
          now = timezone.now()
          tomorrow = (now + timedelta(days=1))
          return self.active_phases().filter(end_date__lte=tomorrow)
  
  
  class Phase(models.Model):
      name = models.CharField(max_length=80, verbose_name=_('Name'))
      description = models.TextField(max_length=300,
                                     verbose_name=_('Description'))
      type = models.CharField(max_length=128, validators=[validate_content])
      module = models.ForeignKey(modules_models.Module, on_delete=models.CASCADE)
      start_date = models.DateTimeField(blank=True, null=True,
                                        verbose_name=_('Start date'))
      end_date = models.DateTimeField(blank=True, null=True,
                                      verbose_name=_('End date'))
      weight = models.IntegerField(default=0)
  
      objects = PhasesQuerySet.as_manager()
  
      class Meta:
          ordering = ['weight']
  
      def __str__(self):
          return '{} ({})'.format(self.name, self.type)
  
      def content(self):
          return content[self.type]
  
      def clean(self):
          if self.end_date and self.start_date:
              if self.end_date < self.start_date:
                  raise ValidationError({
                      'end_date': _('End date can not be smaller'
                                    'than the start date.')
                  })
          super().clean()
  
      @property
      def view(self):
          return content[self.type].view
  
      @property
      def is_over(self):
          return self.end_date <= timezone.now()
  
      def has_feature(self, feature, model):
          return content[self.type].has_feature(feature, model)
  
new_contents: from datetime import timedelta
  
  from django.core.exceptions import ValidationError
  from django.db import models
  from django.utils import timezone
  from django.utils.translation import ugettext_lazy as _
  
  from adhocracy4.modules import models as modules_models
  
  from . import content
  from .validators import validate_content
  
  
  class PhasesQuerySet(models.QuerySet):
  
      def active_phases(self):
          now = timezone.now()
          return self.filter(start_date__lte=now, end_date__gt=now)
  
      def finished_phases(self):
          return self.filter(end_date__lte=timezone.now())
  
      def finish_next(self):
          """
          All phases that are active and finish within 24 hours.
          """
          now = timezone.now()
          tomorrow = (now + timedelta(days=1))
          return self.active_phases().filter(end_date__lte=tomorrow)
  
  
  class Phase(models.Model):
      name = models.CharField(max_length=80, verbose_name=_('Name'))
      description = models.TextField(max_length=300,
                                     verbose_name=_('Description'))
      type = models.CharField(max_length=128, validators=[validate_content])
      module = models.ForeignKey(modules_models.Module, on_delete=models.CASCADE)
      start_date = models.DateTimeField(blank=True, null=True,
                                        verbose_name=_('Start date'))
      end_date = models.DateTimeField(blank=True, null=True,
                                      verbose_name=_('End date'))
      weight = models.IntegerField(default=0)
  
      objects = PhasesQuerySet.as_manager()
  
      class Meta:
          ordering = ['weight']
  
      def __str__(self):
          return '{} ({})'.format(self.name, self.type)
  
      def content(self):
          return content[self.type]
  
      def clean(self):
          if self.end_date and self.start_date:
              if self.end_date < self.start_date:
                  raise ValidationError({
                      'end_date': _('End date can not be smaller'
                                    'than the start date.')
                  })
          super().clean()
  
      @property
      def view(self):
          return content[self.type].view
  
      @property
      def is_over(self):
          return self.end_date <= timezone.now()
  
      def has_feature(self, feature, model):
          return content[self.type].has_feature(feature, model)
  
subject: use ugettext_lazy