X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/75957f735219259d3b4bc361f80ccd3d7b92a0e9..ca8f4e8fef80cb603117ed579da8554f503698e5:/src/catalogue/models/fragment.py?ds=inline diff --git a/src/catalogue/models/fragment.py b/src/catalogue/models/fragment.py index ac0c53908..6609ba8f5 100644 --- a/src/catalogue/models/fragment.py +++ b/src/catalogue/models/fragment.py @@ -1,11 +1,10 @@ -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# This file is part of Wolne Lektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. # from django.conf import settings from django.contrib.contenttypes.fields import GenericRelation from django.urls import reverse from django.db import models -from django.utils.translation import ugettext_lazy as _ from newtagging import managers from catalogue.models import Tag from wolnelektury.utils import cached_render, clear_cached_renders @@ -25,8 +24,8 @@ class Fragment(models.Model): class Meta: ordering = ('book', 'anchor',) - verbose_name = _('fragment') - verbose_name_plural = _('fragments') + verbose_name = 'fragment' + verbose_name_plural = 'fragmenty' app_label = 'catalogue' def get_absolute_url(self): @@ -39,18 +38,6 @@ class Fragment(models.Model): """Returns short version of the fragment.""" return self.short_text if self.short_text else self.text - @cached_render('catalogue/fragment_short.html') - def midi_box(self): - return {'fragment': self} - - @cached_render('catalogue/fragment_promo.html') - def promo_box(self): - return {'fragment': self} - @property def themes(self): return self.tags.filter(category='theme') - - def clear_cache(self): - clear_cached_renders(self.midi_box) - clear_cached_renders(self.promo_box)