From c43b84fe945457ebfceee40869190f831614bd56 Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Sun, 21 Jun 2015 14:55:46 +0900 Subject: [PATCH] display_url Signed-off-by: Hiroshi Miura --- symposion/sponsorship/models.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/symposion/sponsorship/models.py b/symposion/sponsorship/models.py index e29ac3d1..95feeaaa 100644 --- a/symposion/sponsorship/models.py +++ b/symposion/sponsorship/models.py @@ -39,6 +39,7 @@ class Sponsor(models.Model): null=True) name = models.CharField(_("Sponsor Name"), max_length=100) + display_url = models.URLField(_("display URL"), blank=True) external_url = models.URLField(_("external URL")) annotation = models.TextField(_("annotation"), blank=True) contact_name = models.CharField(_("Contact Name"), max_length=100) @@ -65,6 +66,12 @@ class Sponsor(models.Model): return reverse("sponsor_detail", kwargs={"pk": self.pk}) return reverse("sponsor_list") + def get_display_url(self): + if self.display_url: + return self.display_url + else: + return self.external_url + @property def website_logo(self): if self.sponsor_logo is None: