X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/7fdf8249c9c016e397edc3112184e74b0f3f9778..e97becbbb360b14527801bfc22c3e1ab3fd288a1:/apps/catalogue/models/book.py diff --git a/apps/catalogue/models/book.py b/apps/catalogue/models/book.py index 414d1effb..27240fbd5 100644 --- a/apps/catalogue/models/book.py +++ b/apps/catalogue/models/book.py @@ -8,6 +8,7 @@ from django.core.cache import get_cache from django.db import models from django.db.models import permalink import django.dispatch +from django.core.urlresolvers import reverse from django.utils.datastructures import SortedDict from django.utils.translation import ugettext_lazy as _ import jsonfield @@ -612,6 +613,14 @@ class Book(models.Model): audiences = sorted(set([self._audiences_pl.get(a, (99, a)) for a in audiences])) return [a[1] for a in audiences] + def stage_note(self): + stage = self.extra_info.get('stage') + if stage and stage < '0.4': + return (_('This work needs modernisation'), + reverse('infopage', args=['wymagajace-uwspolczesnienia'])) + else: + return None, None + def choose_fragment(self): tag = self.book_tag() fragments = Fragment.tagged.with_any([tag])