X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/3e276f49505e607b72892b40d18ac2cef194497e..37dab8f9ef681bfba763ee4f279c9babd49de783:/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):