from django.core.validators import MinValueValidator
from django.db import models
from django.utils.translation import ugettext_lazy as _


class Duration(models.Model):
    conference = models.ForeignKey(
        "conferences.Conference",
        on_delete=models.CASCADE,
        verbose_name=_("conference"),
        related_name="durations",
    )

    name = models.CharField(_("name"), max_length=100)
    duration = models.PositiveIntegerField(
        _("duration"), validators=[MinValueValidator(1)]
    )
    notes = models.TextField(_("notes"), blank=True)
    allowed_submission_types = models.ManyToManyField(
        "submissions.SubmissionType", verbose_name=_("allowed submission types")
    )

    def __str__(self):
        return f"{self.name} - {self.duration} mins ({self.conference_id})"

    class Meta:
        verbose_name = _("Duration")
        verbose_name_plural = _("Durations")

@@ -742,16 +742,30 @@
  return 
+(%0A            
 f%22%7Bself.
@@ -798,30 +798,97 @@
 ns (
-%7Bself.conference_id%7D)%22
+at Conference %22%0A            f%22%7Bself.conference.name%7D %3C%7Bself.conference.code%7D%3E)%22%0A        )
 %0A%0A  

Fix Duration.__str__ to show Conference name and code