display_url

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
This commit is contained in:
Hiroshi Miura 2015-06-21 14:55:46 +09:00
parent 91ae3de6df
commit c43b84fe94

View file

@ -39,6 +39,7 @@ class Sponsor(models.Model):
null=True) null=True)
name = models.CharField(_("Sponsor Name"), max_length=100) name = models.CharField(_("Sponsor Name"), max_length=100)
display_url = models.URLField(_("display URL"), blank=True)
external_url = models.URLField(_("external URL")) external_url = models.URLField(_("external URL"))
annotation = models.TextField(_("annotation"), blank=True) annotation = models.TextField(_("annotation"), blank=True)
contact_name = models.CharField(_("Contact Name"), max_length=100) 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_detail", kwargs={"pk": self.pk})
return reverse("sponsor_list") return reverse("sponsor_list")
def get_display_url(self):
if self.display_url:
return self.display_url
else:
return self.external_url
@property @property
def website_logo(self): def website_logo(self):
if self.sponsor_logo is None: if self.sponsor_logo is None: