X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/19e20c4e4b6a7940977a293698d61e75810ff321..bff8ff8102fe26b61205c444d29024cdf6c9f6e7:/apps/cover/models.py diff --git a/apps/cover/models.py b/apps/cover/models.py index 87a70a80..14026ac7 100644 --- a/apps/cover/models.py +++ b/apps/cover/models.py @@ -12,6 +12,7 @@ from django.db import models from django.db.models.signals import post_save from django.dispatch import receiver from django.utils.translation import ugettext_lazy as _ +from django.contrib.sites.models import Site class Image(models.Model): @@ -34,6 +35,9 @@ class Image(models.Model): def get_absolute_url(self): return ('cover_image', [self.id]) + def get_full_url(self): + return "http://%s%s" % (Site.objects.get_current().domain, self.get_absolute_url()) + @receiver(post_save, sender=Image) def download_image(sender, instance, **kwargs):