-# -*- coding: utf-8 -*-
-#
# This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
+from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
from django.contrib.sites.models import Site
from cover.utils import URLOpener
verbose_name = _('cover image')
verbose_name_plural = _('cover images')
- def __unicode__(self):
+ def __str__(self):
return u"%s - %s" % (self.author, self.title)
- @models.permalink
def get_absolute_url(self):
- return 'cover_image', [self.id]
+ return reverse('cover_image', args=[self.id])
def get_full_url(self):
return "http://%s%s" % (Site.objects.get_current().domain, self.get_absolute_url())