X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/2421e92f4731766547e99bf3ccae992f7b6411ff..c589bdc8926f9fb7d4b34a2c6569fa4feae833f0:/src/catalogue/models.py?ds=sidebyside diff --git a/src/catalogue/models.py b/src/catalogue/models.py index bb738a26..ce7a5722 100644 --- a/src/catalogue/models.py +++ b/src/catalogue/models.py @@ -168,14 +168,11 @@ class Book(WikidataMixin, models.Model): DBook = apps.get_model("documents", "Book") return DBook.objects.filter(dc_slug=self.slug) - def estimated_costs(self): - return "\n".join( - "{}: {} zł".format( - work_type.name, - work_type.calculate(self) or '—' - ) + def get_estimated_costs(self): + return { + work_type: work_type.calculate(self) for work_type in WorkType.objects.all() - ) + } class Collection(models.Model):